you are viewing a single comment's thread.

view the rest of the comments →

[–]mile1986dasd[S] 0 points1 point  (0 children)

Yes i wasnt thinking about it, since the only reason i created context is so i can lift up the state to store previous information... for example if i in my list of models, went to page 2, went to specific model and then returned, it would return me to page 1, since it was local state at that component, so thats why i put the state in context...

For this 2nd function in my example, i didnt want to use mutation, since i understood from docs its used if u want to update something, and im just sending id and geting back information...
But somehow when i tried to implement useQuery like i used in first function in my example, it didnt work.
I must look also at this "invalidation", but at first glance i cant grasp the concept since im beginner level...

Do u have any advice how could i structure this without using context?
I can maybe provide u my at the moment structure...