#Interaction between layout.tsx and page.tsx

2 messages · Page 1 of 1 (latest)

fluid python
#

Hey,

I am creating an app in Next.js 13. If I need interaction between two components I usually have a function in parent component and pass it down to a child component where the child is able to call the function and change data.

I am trying to do a similar thing but not sure how to do it with layout.tsx. I need to press a button in layout.tsx and have data change in page.tsx.

What would you guys reccomend? Maybe use state library like zustard?

Thanks

junior bronze
#

you need to use global state management, redux and react query are popular for this