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

Update Router and Link type definitions #435

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

billybimbob
Copy link

This PR modifies the type definitions to Router and Link in order to better represent their actual implmentations.

The type definitions for the Link component in preact-router and preact-router/match have some ambiguity between each other, which causes problems like #379. The base Link type definition is now more restricted to make clear that activeClassName can only be applied to the match variant.

onClick is also now omitted as a link prop in order to ensure that the onClick handler used by preact-router is not overriden.

The match Link variant can also now take in extra props of activeClass and path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant