Use this hook similar to useState hook. The difference is that you need to pass a unique key - unique across the app to make this state accessible to all client components.
useState
const [state, setState] = useRGS<number>("counter", 1); Copy
const [state, setState] = useRGS<number>("counter", 1);
Unique key to identify the store.
Optional
Initial value of the store.
Use this hook similar to
useState
hook. The difference is that you need to pass a unique key - unique across the app to make this state accessible to all client components.Example