30秒学会 React 片段 – React usePersistedState hook
Returns a stateful value, persisted in localStorage, and a function to update it. Use the useState()...
Returns a stateful value, persisted in localStorage, and a function to update it. Use the useState()...
Creates a stateful Map object, and a set of functions to manipulate it. Use the useState() hook and ...
Executes a callback whenever the window is resized. Use the useRef() hook to create a variable, list...
Forces the component to re-render when called. Use the useReducer() hook that creates a new object e...
Delays creating a stateful value until some condition is met. Use the useState() hook to create a st...
Tracks the dimensions of the browser window. Use the useState() hook to initialize a state variable ...
Creates a stateful value, returning a getter and a setter function. Use the useRef() hook to create ...
Handles the beforeunload window event. Use the useRef() hook to create a ref for the callback functi...
Creates a stateful value that is persisted to sessionStorage, and a function to update it. Use the u...
Debounces the given value. Create a custom hook that takes a value and a delay. Use the useState() h...