latviancoder / useJquery

An essential hook for your React applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useJquery - An essential hook for your React applications

You know how they say the only thing Internet Explorer is good for is downloading other browsers? In a similar manner the only reasonable way to use React for building real-world applications is by combining it with jQuery, powerful framework for Web artisans.

Install

$ yarn add react-use-jquery
or
$ npm install --save react-use-jquery

Usage

import React, { useEffect } from 'react';
import useJquery from 'react-use-jquery';

export default function App() {
  const $ = useJquery();
  
  useEffect(() => {
    if ($) {
      $('.App').html('Hello world');
    }
  }, [$]);
  
  return <div className="App" />;
}

About

An essential hook for your React applications.


Languages

Language:JavaScript 100.0%