Skip to content

Commit 6e769d2

Browse files
authored
Update react.md (#514)
I had to modify `app/javascript/packs/application.js` to get this to work for me. I'm not sure if this was a recent update to the structure of shakapacker. I thought the documentation should be updated to help future readers.
1 parent 13a60e0 commit 6e769d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/react.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Update the Babel configuration in the `package.json` file:
3434
},
3535
```
3636

37-
And that's it. You can now create a React app using `app/javascript/application.js` as your entry point.
37+
And that's it. You can now create a React app using `app/javascript/packs/application.js` as your entry point.
3838

3939
## Enabling Hot Module Replacement (HMR)
4040

@@ -152,7 +152,7 @@ echo '<div id="root"></div>' > app/views/site/index.html.erb
152152
touch app/javascript/App.css app/javascript/App.js
153153
```
154154

155-
4. Edit `app/javascript/application.js` like so:
155+
4. Edit `app/javascript/packs/application.js` like so:
156156
```jsx
157157
import React from 'react';
158158
import { createRoot } from 'react-dom/client';
@@ -267,4 +267,4 @@ rails s
267267

268268
11. Edit either the React component at `app/javascript/App.js` or the CSS file at `app/javascript/App.css` and observe the HMR goodness.
269269

270-
Note that HMR will not work if you edit `app/javascript/application.js` and experience a full refresh with a warning in the console. For more info on this, see here: https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/177
270+
Note that HMR will not work if you edit `app/javascript/packs/application.js` and experience a full refresh with a warning in the console. For more info on this, see here: https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/177

0 commit comments

Comments
 (0)