30秒学会 React 片段 – React useOnWindowResize hook
Executes a callback whenever the window is resized. Use the useRef() hook to create a variable, list...
Executes a callback whenever the window is resized. Use the useRef() hook to create a variable, list...
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...
Observes visibility changes for a given element. Use the useState() hook to store the intersection v...
Creates a stateful value, and a function to update it by merging the new state provided. Use the use...
Checks if the code is running on the browser or the server. Create a custom hook that returns an app...