Image for post
Image for post
Photo by Clément H on Unsplash

Since Laravel 5.5, there is an easy way to use React in your Laravel Application. By default, a fresh Laravel application comes with Vue JavaScript framework. To use React instead of Vue, follow the following steps.

Let’s create a new Laravel project using composer by entering the following command to the command line interface.

composer create-project — prefer-dist laravel/laravel laravel-react

Change the current working directory to our new Laravel project.

cd laravel-react

Let’s set the preset to React.

php artisan preset react

Finally, let’s install the dependencies for React.

npm install

That’s how simple it is to use React in a Laravel Project.

Happy Coding!

About

Mark Rev

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store