Home > @lndsld/react-hooks > usePropState
Create state from prop
This state will by synced with prop
Signature:
declare function usePropState<T>(prop: T): [T, Dispatch<SetStateAction<T>>];
| Parameter | Type | Description |
|---|---|---|
| prop | T | prop value |
Returns:
[T, Dispatch<SetStateAction<T>>]