30秒学会 React 片段 – React usePortal hook
Creates a portal, allowing rendering of children outside the parent component. Use the useState() ho...
Creates a portal, allowing rendering of children outside the parent component. Use the useState() ho...
Creates an error dispatcher. Use the useState() hook to create a state variable that holds the error...
Tracks the browser’s location search param. Use the useCallback() hook to create a callback th...
Handles the event of hovering over the wrapped component. Use the useState() hook to create a variab...
Renders an image that supports lazy loading. Use the useState() hook to create a stateful value that...
Renders a link formatted to call a phone number (tel: link). Use phone to create a <a> element...
Tracks the browser’s location hash value, and allows changing it. Use the useState() hook to l...
Creates a stateful value with a default fallback if it’s null or undefined, and a function to ...
Creates a stateful value that is persisted to localStorage, and a function to update it. Use the use...
Runs a callback at most once when a condition becomes true. Use the useRef() hook to create a variab...