We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b7cff0 commit 441e082Copy full SHA for 441e082
lib/generators/react/component_generator.rb
@@ -130,7 +130,9 @@ def component_name
130
def file_header
131
if webpacker?
132
if options[:coffee]
133
- %|React = require('react')\n|
+ %|import React from 'react'\n|
134
+ %|import PropTypes from 'prop-types'\n|
135
+ %|export default |
136
else
137
%|var React = require("react")\n|
138
end
@@ -140,12 +142,8 @@ def file_header
140
142
141
143
144
def file_footer
- if webpacker?
- if options[:coffee]
145
- %|module.exports = @#{component_name}|
146
- else
147
- %|module.exports = #{component_name}|
148
- end
+ if webpacker? && !options[:coffee]
+ %|module.exports = #{component_name}|
149
150
''
151
0 commit comments