Skip to content

Latest commit

 

History

History

use.persistref

@rcp/use.persistref

NPM version NPM Downloads

Persist the ref value

Installation

npm install @rcp/use.persistref
# or use yarn
yarn add @rcp/use.persistref

Usage

import usePersistRef from '@rcp/use.persistref'

const App = ({ val }) => {
  const valRef = usePersistRef(val)

  valRef.current === val
}

API

Related

Authors

This library is written and maintained by 余聪, [email protected].

License

MIT