preact-async-route icon indicating copy to clipboard operation
preact-async-route copied to clipboard

Mark path prop as optional

Open devmattrick opened this issue 4 years ago • 0 comments

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!

devmattrick avatar Jul 31 '21 11:07 devmattrick