Skip to main content

useRtRef

确保ref.current实时更新传入最新值,不需要手动赋值

安装

npm install @jelper/hooks

引入

import { useRtRef } from '@jelper/hooks';

样例

基础用法

count: 0
syncData: 0

API

useRtRef

参数说明类型默认值版本
useRtRef实时同步 useRtRef 传入值<T>(val: T) => React.MutableRefObject<T>--