laravel and react
18 July 2017Some notes on setting up Laravel with React.
-
Remove the reference to Vue from
devDependencies
. -
npm install
. -
npm install --save react react-dom
. -
Replace the code in
resources/assets/js/app.js
with the root React boilerplate (importing the rootApp.js
component and rendering it to the DOM). -
Replace
components/Example.vue
withApp.js
. -
Set up the root div in the home view and route to it if necessary.
-
In
webpack.mix.js
, replacemix.js
withmix.react
. -
npm run watch
.