Skip to content

Commit 9bb7b2c

Browse files
committed
feat(config) accept transformer class from config
1 parent 9a4f6ab commit 9bb7b2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/react/rails/railtie.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Railtie < ::Rails::Railtie
99
config.react.variant = (::Rails.env.production? ? :production : :development)
1010
config.react.addons = false
1111
config.react.jsx_transform_options = {}
12+
config.react.jsx_transformer_class = React::JSX::BabelTransformer
1213
# Server rendering:
1314
config.react.server_renderer_pool_size = 10
1415
config.react.server_renderer_timeout = 20 # seconds
@@ -23,6 +24,7 @@ class Railtie < ::Rails::Railtie
2324
# Include the react-rails view helper lazily
2425
initializer "react_rails.setup_view_helpers", group: :all do |app|
2526
React::JSX.transform_options = app.config.react.jsx_transform_options
27+
React::JSX.transformer_class = app.config.react.jsx_transformer_class
2628
ActiveSupport.on_load(:action_view) do
2729
include ::React::Rails::ViewHelper
2830
end

0 commit comments

Comments
 (0)