Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
|
- /**
- * Store the last of some value. Tracked via a `Ref` only updating it
- * after the component renders.
- *
- * Helpful if you need to compare a prop value to it's previous value during render.
- *
- * ```ts
- * function Component(props) {
- * const lastProps = usePrevious(props)
- *
- * if (lastProps.foo !== props.foo)
- * resetValueFromProps(props.foo)
- * }
- * ```
- *
- * @param value the value to track
- */
- export default function usePrevious<T>(value: T): T | null;
|