@hrdtbs/use-jquery
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @hrdtbs/use-jquery

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

3.07 kB

Total Files

5

Last publish

Collaborators

  • hrdtbs