@uiw/react-native
Version:
UIW for React Native
15 lines (14 loc) • 436 B
TypeScript
/**
* 获取上一轮的 props 或 state
* How to get the previous props or state?
* https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
* @example
* ```js
* function Counter() {
* const [count, setCount] = useState(0);
* const prevCount = usePrevious(count);
* return <h1>Now: {count}, before: {prevCount}</h1>;
* }
* ```
*/
export declare function usePrevious<T>(value: T): T | undefined;