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

Passing props from layout to page #2884

Closed
sungwoncho opened this issue Nov 11, 2017 · 2 comments
Closed

Passing props from layout to page #2884

sungwoncho opened this issue Nov 11, 2017 · 2 comments

Comments

@sungwoncho
Copy link

I would like to pass props from layout to pages. But I could not find any documentation. Does Gatsby support this, and if not, would you consider a PR?

I think this is reasonable if a user wants a state to be fetched and shared in all pages (such as loggedIn). Wrapping each page with HOC is a solution but we can't use the state in something outside a page but inside the layout (e.g. <Header>).

@ooloth
Copy link
Contributor

ooloth commented Nov 14, 2017

I was just searching for this myself!

Check out Kyle's comment here. It worked well for me.

@pieh
Copy link
Contributor

pieh commented May 30, 2018

Closing issue, it was answered in previous comment.

@pieh pieh closed this as completed May 30, 2018
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

No branches or pull requests

3 participants