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

Mark path prop as optional #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devmattrick
Copy link

The path prop on the AsyncRoute component is not required like the TypeScript types currently reflect. This PR simply marks it as optional.

I bumped into this issue when I was trying to use an AsyncRoute as the default route like mentioned in the preact-router docs:

<Router>
  <A path="/" />
  <B path="/b" id="42" />
  <C path="/c/:id" />
  <C path="/d/:optional?/:params?" />
  <D path="/e/:remaining_path*" />
  <E path="/f/:remaining_path+" />
  <F default />   <-- There is no path attribute on this component
</Router>

Thanks!

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.

1 participant