Check you have correctly imported and set up Ziggy in your React component. Beacuse Ziggy provides a route() function. Follow these examples:
Import the Hook:
import React from 'react'; import { InertiaLink, usePage } from '@inertiajs/inertia-react';
Access the Current Route:
const { url } = usePage();
Conditionally Render Your Link Component
const isActive = (path) => url === path;
return (<InertiaLink href={route('home')} className={isActive('/about') ? 'text-blue' : 'text-green'} >Home);