@cylution/react-dynamic-refs
v1.0.1
Published
react dynamic refs
Downloads
11
Maintainers
Readme
@cylution/react-dynamic-refs
npm i @cylution/react-dynamic-refs
Or
yarn add @cylution/react-dynamic-refs
Usage
import React from 'react'
import { useDynamicRefs } from '@cylution/react-dynamic-refs'
export const Test = () => {
const refs = useDynamicRefs()
// access ref
// refs.anyTag.current?.[[method]]
return (
<AnyTag ref={refs.anyTag}>
<Depth ref={refs.depth}>
// just refs.[[any]]
</Depth>
</AnyTag>
)
}