1

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.

...

2
  • 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. Commented Mar 6, 2022 at 4: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. Commented Mar 6, 2022 at 8:02

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

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
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.