moxystudio / next-layout

Add persistent and nested layouts to your Next.js projects in a declarative way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: get layout props from data fetching methods (gSSP, gSP, gIP)

kylemh opened this issue · comments

How do I pass props returned from getStaticProps to the layout passed to withLayout?

The layout receives children as props, which again has its props, so you can do:

const {yourProp} = children.props