We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12a944f commit 26a474eCopy full SHA for 26a474e
lib/react/rails/railtie.rb
@@ -33,9 +33,13 @@ class Railtie < ::Rails::Railtie
33
end
34
35
# Rails checks these objects for changes:
36
- app.reloaders << app.config.file_watcher.new([], reload_paths) {}
+ react_reloader = app.config.file_watcher.new([], reload_paths) do
37
+ React::ServerRendering.reset_pool
38
+ end
39
+ app.reloaders << react_reloader
40
+
41
# Reload renderers in dev when files change
- config.to_prepare { React::ServerRendering.reset_pool }
42
+ config.to_prepare { react_reloader.execute_if_updated }
43
44
45
# Include the react-rails view helper lazily
0 commit comments