-
Notifications
You must be signed in to change notification settings - Fork 10
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
TypeScript types don't match implementation #69
Comments
+1 for the |
As a workaround, I followed this guide to overriding the type definitions (in reality inserting new type definitions that have higher precedence). Versions:
|
Any updates about this issue? tnx |
+1 I'm itching for a fix. For context, this issue occurs with React 18 and not React 17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the TypeScript type definitions do not match the documentation nor the implementation. Here are the problems I've encountered so far in one afternoon of integrating the library:
<ErrorBoundary>
has afallbackUI
prop, which is aReactNode
(the result of rendering a component) in types, but is assumed to be a function (a functional component) in the implementation. The correct type would most likely beReact.ComponentType<{}>
orReact.FC<{}>
.historyContext
has multiple issues:filter
andformatter
functions receivelocation
as a string, but it is in fact aLocation
object, not a string.filter
andformatter
are documented as optional, but they are required arguments in types.action
andfilter
, but this seems like a copy-paste mistake and the correct signature is probably(location: Location, action: string)
.Location
type, unless you want to take a dependency onhistory
.The text was updated successfully, but these errors were encountered: