Skip to content

Commit 5cbbcca

Browse files
committed
simplify to_prepare
1 parent 7317247 commit 5cbbcca

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/react/rails/railtie.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ class Railtie < ::Rails::Railtie
3535
# Rails checks these objects for changes:
3636
app.reloaders << ActiveSupport::FileUpdateChecker.new([], reload_paths)
3737
# Reload renderers in dev when files change
38-
if Gem::Version.new(::Rails::VERSION::STRING) >= Gem::Version.new("5.x")
39-
ActiveSupport::Reloader.to_prepare { React::ServerRendering.reset_pool }
40-
else
41-
ActionDispatch::Reloader.to_prepare { React::ServerRendering.reset_pool }
42-
end
38+
config.to_prepare { React::ServerRendering.reset_pool }
4339
end
4440

4541
# Include the react-rails view helper lazily

0 commit comments

Comments
 (0)