Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render prop pattern #32

Merged

Conversation

thompsongl
Copy link

Here's one way (preferred) to avoid needing to manage state from the parent component, using a render prop.

We pass "up" the setIsFullScreen function for use in the higher component. Note that the isFullScreen prop you used previously can still work to set initial state, but it could also be removed entirely.

@cchaos
Copy link
Owner

cchaos commented Mar 18, 2020

Ugh, so I thought about something like this solution as well and had tried it but I might not have connected all the dots. 🙇‍♀

@cchaos cchaos merged commit fc331d5 into cchaos:into-feature/all_together Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants