Is it a good practice to use Inertia.reload() in your laravel project when you want to reload your component after a post request? If you think there is another way that would be better don't hesitate to suggest me.
Front React
const addToFavorite = async (videogameId: number) => {
await axios.post(route("favorites.store"), {
videogame_id: videogameId,
user_id: currentUserId,
});
Inertia.reload();
};
<button type="button" onClick={() => addToFavorite(videogame.id)}>
<StarIcon />
</button>
Controller
public function store(FavoriteRequest $request)
{
$favorite = Favorites::create($request->all());
$favorite->save();
return redirect()->back();
}