0

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.

...

medilies
  • 1,811
  • 1
  • 8
  • 32
  • This question is likely to be answered with opinions rather than facts and citations. It should be updated so it will lead to fact-based answers. – Wahyu Kristianto Mar 06 '22 at 04:50
  • @WahyuKristianto check my edit. I never used ReactJS before and I won't be comfortable integrating it in a project without knowing that I did it in a correct way. – medilies Mar 06 '22 at 08:02

1 Answers1

1

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

scrumbo
  • 26
  • 2
  • Thank you so much for the quote. Also I prefer Tailwind over Bootstrap which will highly encourages me to avoid laravel/ui if it enforces using it or requires alot of tweaking to replace it with tailwind – medilies Mar 07 '22 at 18:08
  • 1
    The word **legacy** is enough to kill it for me. But you can visit the repo and see Bootstrap all around the project. I see Mix as the futur of bringing FrontEnd JS to Laravel projects – scrumbo Mar 07 '22 at 18:24