I have tried importing jquery file in index.html for using jquery $ in react component.
And I tried like that $(‘button’).click(function()) in component.
At that time, I faced errors, $ is not undifined.
I think there are good ways to use jquery. Please feel free to answer me about that.
In index.html
In component
$("button").click(function(){})
2
Answers
I can try that using node_module ‘jquery’.
import $ from ‘jquery’;
You can use like that.
In component
window.$(‘button’).click(function(){})