passing data to children
Answered
Mud-daubers posted this in #help-forum
Mud-daubersOP
hey guys, for next js app router, (specifically the layout.js file) - is it possible to pass data to the children? for example right now im calling the same endpoint e.g., '/api/user' on each page to get the users detail. Is there a more efficient way to do this, e.g., just call it once and pass it to the children the data recieved
1 Reply
@Mud-daubers hey guys, for next js app router, (specifically the layout.js file) - is it possible to pass data to the children? for example right now im calling the same endpoint e.g., '/api/user' on each page to get the users detail. Is there a more efficient way to do this, e.g., just call it once and pass it to the children the data recieved
you can create a context and then use the data from there
Answer