A unique key to identify the global store.
Optional
value: ValueType<T>The initial value of the global state. Can be a value or a function returning a value.
Optional
includeRegExp: null | 0 | RegExp(Optional) A regular expression to specify which fields trigger updates.
Optional
excludeRegExp: RegExp(Optional) A regular expression to specify which fields should be excluded from updates.
A tuple containing the current state and a function to update the state.
A React hook for managing shared global state, similar to the
useState
hook. This hook requires a unique key, which identifies the global store and allows state sharing across all client components.Example
See
Learn More