Persist the ref value
npm install @rcp/use.persistref
# or use yarn
yarn add @rcp/use.persistref
import usePersistRef from '@rcp/use.persistref'
const App = ({ val }) => {
const valRef = usePersistRef(val)
valRef.current === val
}
This library is written and maintained by 余聪, [email protected].
MIT