usePreviousDifferent
Aboutβ
usePreviousDifferent returns the last different value of a variable
Installationβ
npm install --save rooks
Importing the hookβ
import { usePreviousDifferent } from 'rooks';
Usageβ
function Demo() {
const [value, setValue] = useState(0);
const previousValue = usePreviousDifferent(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.