How to wrap <Link /> in a styled component and sync the active state? And get typesafety
@Tanner Linsley saw somone asked you this here as well https://discord.com/channels/719702312431386674/1007702008448426065/1128108663819747490
I tried this implementation below. Not sure if this is the best way of doing this but not sure how to get type safety of the routes and apply active/inactive styling with the button wrapping the Link
any suggestions?

5 Replies
vicious-goldOP•3y ago
This is the navbar
equal-jade•3y ago
vicious-goldOP•3y ago
thanks ! hmm weird. my navbar is in a ui lib in a mono repo. When i export the type out of apps/web it doesn't share the config , but does from within the app/web package


equal-jade•3y ago
🤷🏻 sorry no idea about that
vicious-goldOP•3y ago
I figured this out, needed to use
aschild prop in my button