usePreviousImmediate
Aboutβ
usePreviousImmediate returns the previous value of a variable even if it was the same or different
Installationβ
npm install --save rooks
Importing the hookβ
import usePreviousImmediate from 'rooks';
Usageβ
function Demo() {
const [value, setValue] = useState(0);
const previousValue = usePreviousImmediate(value);
return null;
}
render(<Demo />);
Codesandbox Examplesβ
Basic Usageβ
Join Bhargav's discord serverβ
You can click on the floating discord icon at the bottom right of the screen and talk to us in our server.