#Issue with polymorphic button

2 messages · Page 1 of 1 (latest)

fringe dew
#

Hello there, this is a button component that I'm using as a react-router nav link, which uses a function to customize the class name applied depending on if the route is active or not, however, I think the mantine prop is overwriting it. Is there any way around this?

<Button
            component={NavLink}
            key={link.label}
            to={link.link}
            className={({ isActive }) => {
                console.log("Checking");
                console.log(isActive);
                return isActive ? classes.linkActive : classes.link;
            }}
            variant="light">
            {link.label}
        </Button>

https://files.jellyton.me/ShareX/2023/07/Code_-_July13_-_17.18_-_2505.png

grand quartz