diff --git a/docs/react.md b/docs/react.md index b2320aff..25847558 100644 --- a/docs/react.md +++ b/docs/react.md @@ -34,7 +34,7 @@ Update the Babel configuration in the `package.json` file: }, ``` -And that's it. You can now create a React app using `app/javascript/application.js` as your entry point. +And that's it. You can now create a React app using `app/javascript/packs/application.js` as your entry point. ## Enabling Hot Module Replacement (HMR) @@ -152,7 +152,7 @@ echo '
' > app/views/site/index.html.erb touch app/javascript/App.css app/javascript/App.js ``` -4. Edit `app/javascript/application.js` like so: +4. Edit `app/javascript/packs/application.js` like so: ```jsx import React from 'react'; import { createRoot } from 'react-dom/client'; @@ -267,4 +267,4 @@ rails s 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. -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 +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