Having hard time to pass props/objects from page to page
Answered
HOTCONQUEROR posted this in #help-forum
Basically, i am aware of
Also, i don't want anything to appear on the url query, i am simply trying to pass object from component to component using Next.js
how do i do that?
query props on Link API, however , i am willing to pass a literal js object from page to another dynamic page, basically something like, from /page to /page/[specific_page]Also, i don't want anything to appear on the url query, i am simply trying to pass object from component to component using Next.js
how do i do that?
Answered by Clown
If i understood correctly you want to send data from one page to another. If you simply use a context, you can do that. Obviously its not very persistent because if you do a hard refresh that data is gone.
As for the loading state, its just waiting for the component to mount.
As for the loading state, its just waiting for the component to mount.
9 Replies
Unfortunately the only thing i can think of here is using Context API OR a state management library for that matter
@Clown Unfortunately the only thing i can think of here is using Context API OR a state management library for that matter
the problem is that context data is only ready after the page is fully rendered
ffs
Welp that's something you're going to have to deal with
@Clown Welp that's something you're going to have to deal with
how do you deal with it?
@HOTCONQUEROR how do you deal with it?
You wait till the context is available and show a loading state while it isnt
@Clown You wait till the context is available and show a loading state while it isnt
as in, i need to create a new state for loading?
If i understood correctly you want to send data from one page to another. If you simply use a context, you can do that. Obviously its not very persistent because if you do a hard refresh that data is gone.
As for the loading state, its just waiting for the component to mount.
As for the loading state, its just waiting for the component to mount.
Answer
yeah ok, i got it thanks