Laravel Reactjs:Changes Are Not Reflecting After Change in My Js(Reactjs) File

React not updating the DOM (Laravel)

Alright, so I got down to the bottom of it.

The problem was that I was including my client.min.js file before the default app.js file of laravel 5.4's default layout. For some reason it broke react in a very weird way. What I had to do is switch the order in which the two files were included.

reactjs server doesnt auto refresh if i make changes in index.js

Create a .env file then write in file

 FAST_REFRESH=false

Made changes to React component but Laravel shows old component

There are multiple layers of cache that you need to clear

php artisan view:clear

And delete the public/js/app.js file and run

npm run prod

Also, make sure to restart your opcache if enabled

Also, purge the cache from Cloudflare or similar service if you're using those

And finally, test your website with a private window or Guest Mode on Google Chrome

blade view not updated

You need to compile the changes when up update your resources files.

npm run dev

See: https://laravel.com/docs/6.x/mix for full details on other commands.



Related Topics



Leave a reply



Submit