preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.01k stars 156 forks source link

Type definition doesn't allow function to be passed into `<Match />` `children`. #458

Open kim3er opened 1 year ago

kim3er commented 1 year ago

This should work:

<Match path="/cookie-policy">
  {({ matches }) => !matches && <CookieConsent />}
</Match>

But the following error is returned:

Binding element 'matches' implicitly has an 'any' type.ts(7031)