mirror of
https://github.com/outline/outline.git
synced 2026-06-23 16:24:23 +03:00
57fa1305a6
* First steps of remove react-keydown, replace with hook * RegisterKeyDown component to aid transition away from react-keydown
11 lines
214 B
JavaScript
11 lines
214 B
JavaScript
// @flow
|
|
import * as React from "react";
|
|
|
|
export default function usePrevious<T>(value: T): T | void {
|
|
const ref = React.useRef();
|
|
React.useEffect(() => {
|
|
ref.current = value;
|
|
});
|
|
return ref.current;
|
|
}
|