question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

➙ Screencast showing the issue

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
rmosolgocommented, Aug 11, 2017

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

Maybe our usage there needs to be updated!

0reactions
BookOfGregcommented, Mar 9, 2018

Thanks all for the help with this one 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found