Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modify return type of className of NavLinkProps interface #8542

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

koojaa
Copy link
Contributor

@koojaa koojaa commented Dec 29, 2021

It seems that there's a type collision between current NavLink interface and NavLink example demonstrated on docs.

<NavLink
    to="tasks"
    className={({ isActive }) =>
        isActive ? activeClassName : undefined
    }
>
    Tasks
</NavLink>

// Type 'string | undefined' is not assignable to type 'string'.

IMO it looks good to add undefined return type for the classname of NavLink prop instead of modifying an example.

(Existing tests passed, should any further test be required?)

@timdorr
Copy link
Member

timdorr commented Dec 29, 2021

Can you add a test that uses undefined for the return value? That'll prevent a reversion later.

@koojaa
Copy link
Contributor Author

koojaa commented Dec 29, 2021

@timdorr Sure 🙂

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Dec 29, 2021

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@timdorr timdorr requested review from mjackson and chaance December 30, 2021 01:25
@chaance chaance merged commit 9bdf8ae into remix-run:main Jan 4, 2022
brophdawg11 pushed a commit that referenced this pull request Mar 27, 2024

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants