@hrdtbs/use-jquery
v0.0.2
Published
React Hooks of jQuery
Downloads
1
Readme
useJQuery
$ yarn add @hrdtbs/use-jquery jquery react @types/jquery @types/react
const App:React.FC = () => {
const ref = useRef<HTMLDivElement>(null)
useJQuery(ref, $ => {
$.fadeOut(3000).fadeIn(3000)
})
const text = useJQuery(ref, $ => {
return $.text()
})
useEffect(()=> {
console.log(text)
},[text])
return (
<div ref={ref}>Hello, jQuery</div>
)
}