-
Notifications
You must be signed in to change notification settings - Fork 754
React out of sync #1049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I could not replicate on Rails 5.2.4.1, or on Rails 6.0.2.1. Made a small test repo here: |
The project is using typescript. It happens intermittently, especially if there was an error in the code base when webpacker attempts to compile. |
I believe I might be experiencing the same issue, I'm also using typescript.
Load page, you should see the content from components 1 and 2. Now, modify the JSX, reload, modifications made to both components are now visible and console should be error free. I have spent many hours trying to identify what's going on. Seems to be related to some caching or tsx compilation / loader. I'll continue digging, I might setup a repo to reproduce the issue. |
Ok, I feel stupid... I should pay more attention to the documentation. @JustinCann This is what fixed the issue for me: config/application.rb
Ref.: https://github.com/reactjs/react-rails#configuration I think it'd be helpful to add a note about that for TS users. Maybe under this section? |
Closing the issue based on the above solution. |
Steps to reproduce
Run
rails server
and start your application.Make a change to a jsx / tsx file, and save the file.
Expected behavior
The application compiles the javascript, reloads in the browser and shows the changes.
Actual behavior
The application appears to compile the javascript, reloads in the browser and does not show the changes. It appears as though React is out of sync with the rest of the application.
After stopping and starting the server the changes appear.
System configuration
Webpacker version: 4.0
React-Rails version: 2.5
React_UJS version: 2.5.0
Rails version: 6.0.0.rc2
Ruby version: 2.6.0
In development, when making a large amount of javascript changes the application stops refreshing. It's almost as if the react changes are out of sync.
React hangs intermittently after saving a jsx / tsx file.
The text was updated successfully, but these errors were encountered: