Skip to content
An essential hook for your React applications.
JavaScript
Branch: master
Clone or download
latviancoder Merge pull request #3 from CharlesStover/patch-1
Allow version to be specified.
Latest commit e1cd4fa Apr 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Use single quotes in example Apr 1, 2019
index.js Allow version to be specified. Apr 1, 2019
package.json add jQuery as a peer dependency Apr 1, 2019

README.md

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" />;
}
You can’t perform that action at this time.