Add visibility toggle of password input. Closes #2

This commit is contained in:
Maksim Eltyshev
2019-11-15 03:45:59 +05:00
parent a11f6260c0
commit 00c7f514ae
25 changed files with 111 additions and 92 deletions

View File

@@ -0,0 +1,11 @@
import { useEffect, useRef } from 'react';
export default (value) => {
const prevValue = useRef();
useEffect(() => {
prevValue.current = value;
}, [value]);
return prevValue.current;
};