If you need add react in your projects of laravel this is very easy and simple.
1.- Create your app of laravel.
2.- Run this command in your path of project.
This command create configuration and base files of the first component resources/js/ & resources/js/components/Example.js, you need update Example.js
After this you need install all dependences for react
The next step is configure wildcard in your file of routes routes/web.php
And then you need create view with name app.blade.php on resources/views/ and add this configuration
This configuration will be enough to test our application.
For development mode you can run this commands in differents terminals:
npm run watch
php artisan serve
Build for production:
npm run prod
Source code: https://github.com/abelhOrihuela/test-laravel-react
Thanks for reading...
Top comments (0)