File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
lib/generators/react_on_rails
templates/base/base/app/javascript/packs Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,15 @@ def add_base_gems_to_gemfile
7676 run "bundle"
7777 end
7878
79+ def use_local_react_on_rails
80+ false
81+ end
82+
7983 def add_js_dependencies
8084 major_minor_patch_only = /\A \d +\. \d +\. \d +\z /
81- if ReactOnRails ::VERSION . match? ( major_minor_patch_only )
85+ if use_local_react_on_rails
86+ package_json . manager . add ( [ "react-on-rails@link:.yalc/react-on-rails" ] )
87+ elsif ReactOnRails ::VERSION . match? ( major_minor_patch_only )
8288 package_json . manager . add ( [ "react-on-rails@#{ ReactOnRails ::VERSION } " ] )
8389 else
8490 # otherwise add latest
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class DevTestsGenerator < Rails::Generators::Base
1616 default : false ,
1717 desc : "Setup prerender true for server rendered examples"
1818
19+ def use_local_react_on_rails
20+ true
21+ end
22+
1923 def copy_rspec_files
2024 %w[ .eslintrc
2125 spec/spec_helper.rb
Original file line number Diff line number Diff line change 1- import ReactOnRails from 'react-on-rails';
1+ import ReactOnRails from 'react-on-rails/client ';
22
33import <%= config[:component_name] %> from '<%= config[:app_relative_path] %>';
44
You can’t perform that action at this time.
0 commit comments