route.current('..') not updating with inertia.js
See original GitHub issueZiggy version
^1.0
Laravel version
^8.38
Description
It was working fine but lately, I noticed that route.current() not updating on page visits, every time I have to refresh in order to get the right active route
Ziggy call and context
<li class="mainSidebar__rightListItem"
:class="{ 'mainSidebar__rightListItem--active': route().current('dashboard*') }"
></li>
Ziggy configuration
embedded in blade view of laravel
Route definition
Route::get('/dashboard', [
DashboardController::class,
'index',
])->middleware('auth:web')->name('dashboard');
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
Inertia - Ziggy route().current() is undefined - Laracasts
I have installed a fresh laravel 8 project, scaffolded auth with jetstream using Inertia and have then added Ziggy to work with Laravel's...
Read more >Routing - Inertia.js
With Inertia all routing is defined server-side. Meaning you don't need Vue Router or React Router. Simply create routes using your server-side framework...
Read more >laravel - Inertia get request does not update $page.props
My problem is, that the code Inertia.get(route("home"), { q: query }, {preserveState: false}); does not update the vue 3 state.
Read more >The Ultimate Guide to Inertia.js - Kinsta
A look at how Inertia.js makes constructing single-page applications a piece of cake, while solving other problems for developers.
Read more >Using Ziggy with Inertia Server-Side Rendering - Aaron Francis
To see a fully working Laravel Jetstream + Inertia + Ziggy + Sidecar SSR demo repo ... ziggy: path.resolve('vendor/tightenco/ziggy/src/js'),.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found out why.
route().current('dashboard*')
was accessed in a child component of the layout, I had to passroute().current()
as property to the child component to solve it. @bakerkretzmarHaha funny! I was just doing that and was about to post the solution. Thanks!