Search code examples
laravellaravel-mixlaravel-ui

Should I use laravel/ui to integrate ReactJs into a Laravel project


Is there benefits or downsides to using composer require laravel/ui for scaffolding a Laravel with ReactJs project instead of installing ReactJs with npm manually and editing webpack.mix.js

mix.js('resources/js/app.jsx', 'public/js')
   .react();

Is there a conventional/better way to bring ReactJS to Laravel?


  1. Am I likely to miss a setting if I do not use laravel/ui
  2. Will I be enforced to follow some absurd rules if I use laravel/ui
  3. Does laravel/ui really makes the setup easier.

...


Solution

  • I quote from laravel/ui repo the following

    This legacy package is a very simple authentication scaffolding built on the Bootstrap CSS framework. While it continues to work with the latest version of Laravel, you should consider using Laravel Breeze for new projects. Or, for something more robust, consider Laravel Jetstream.

    You can see that the project maintainers recommend in a direct way using another packages.

    You should also take in count that the discussed scaffolding uses Bootstrap by default.

    Finally, I don't see any shortcut in running composer require laravel/ui && php artisan ui react instead of npm install && --save-dev react react-dom and adding .react() to webpack.mix