Account Deleted
Hey Cornelia hope you doing well,
I've seen your solution and it's code, Actually I'm not a typescript developer, But I have for you a little trick to make the active link have specific styling just with react-router-dom without using useEffect in App.tsx file. The trick is do not use Link use NavLink and add(activeClassName) to NavLink. e.g: <NavLink className="nav-link" activeClassName="active-nav" to="/" exact>Home</NavLink>
and style the value of activeClassName(it's active-nav in this example).
source