Skip to main content

usePlexusState

view on npm

A React hook to extract the values from plexus objects and reactively update the component and value when the value changes. This hook returns an array, similar to that of React's useState. The arguments are similar to useState as well, it returns the current value and a function to update the value.

usePlexusState(dep) ⇒

A React hook to extract the values from plexus objects and reactively update the component and value when the value changes. This hook returns an array, similar to that of React's useState. The arguments are similar to useState as well, it returns the current value and a function to update the value.

Returns:

[currentValue, Function] The current value and a function to update the value

ParamDescription
dep

The Plexus dependency to watch