You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using OSD in React, whenever I use a react state inside the OSD code it keeps giving me the initial state without updating it. how to implement it in a react "friendly way" ?
one way around it is the useRef hook, as you said OSD keeps its own state so on initialization it get all the current state values and keeps it as it is and if any change happens it won't reflect on OSD
@SuhaibMaraqa bit late, but hopefully this helps - we use OSD in react as well, and use a redux slice to store a pointer to the OSD instance.
OSD has a getViewer static method, that returns the entire instance - this has worked really well for us, and we don't need to duplicate OSD's state in react specific ways.
I am using OSD in React, whenever I use a react state inside the OSD code it keeps giving me the initial state without updating it. how to implement it in a react "friendly way" ?
The text was updated successfully, but these errors were encountered: