React component doesn't work with `jquery3`
See original GitHub issue- My app crashes with
react-rails
, so I’ve included the stack trace and the exact steps which make it crash. - My app doesn’t crash, but I’m getting unexpected behavior. So, I’ve described the unexpected behavior and suggested a new behavior.
- I’m trying to use
react-rails
with another library, but I’m having trouble. I’ve described my JavaScript management setup (eg, Sprockets, Webpack…), how I’m trying to use this other library, and why it’s not working. - I have another issue to discuss.
When I replace jquery
(which makes everything work fine) with jquery3
(https://github.com/rails/jquery-rails#installation), my React component is included in the final HTML, however, I can’t see it in the browser itself. Also, no errors are displayed in the JS console.
application.js.coffee
:
#= require jquery3
#= require jquery_ujs
#= require react
#= require react_ujs
#= require_tree ./components
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Jquery in React is not defined - Stack Overflow
It happens mostly when JQuery is not installed in your project. Install JQuery in your project by following commands ...
Read more >How to Use jQuery Inside a React Component - Pluralsight
In this guide, we'll look at three different ways to do this: Referencing jQuery context from React. Using helper class, which is passed...
Read more >Integrating with Other Libraries - React
To demonstrate this, let's sketch out a wrapper for a generic jQuery plugin. We will attach a ref to the root DOM element....
Read more >How and when to force a React component to re-render
React automatically re-renders components, but what happens when a component is not updating as expected? Find out what you can do here.
Read more >JavaScript - Bootstrap
Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! thanks for sharing that screencast. Looking at the jQuery 3 upgrade guide, it looks like there were several changes to event handlers.
I guess we should
jquery3
to react-rails test suite to demonstrate the failurereact_ujs
:Maybe our usage there needs to be updated!
Thanks all for the help with this one 👍