-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[Bug]: type errors with exactOptionalPropertyTypes
#11991
Comments
This isn't on us to implement. We are fine with You should be using |
Hi,
Your code is part of the source for my project, AFAIK,
I think there is a misunderstanding between us. I don't want you to make the properties required, I would like to see the typings reformulated in such a way that they allow type AgnosticBaseRouteObject = {
caseSensitive?: boolean | undefined;
path?: string | undefined;
id?: string | undefined;
loader?: LoaderFunction | boolean | undefined;
action?: ActionFunction | boolean | undefined;
hasErrorBoundary?: boolean | undefined;
shouldRevalidate?: ShouldRevalidateFunction | undefined;
handle?: any;
lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
}; Happy to send in a PR if you agree. |
You should be importing our built type definition from npm, not including the full source in your project. That's not something we support. We have validated those according to our own compiler config, so you don't have to validate them again. That is the main purpose of And we would prefer not to have to be explicit about |
I am using the NPM package and the issue is present nonetheless.
The way I understand it and read it in the available resources, compiled lib type definitions are to be considered as part of the compilation.
Unfortunately, this means you are forcing all your downstream users to either forgo more precise optional property typing (which I get not everybody wants, but this way it's not possible for me), or to have to have the compatibility with libraries disabled. |
What version of React Router are you using?
6.26.2
Steps to Reproduce
exactOptionalPropertyTypes
in your tsconfigExpected Behavior
No errors
Actual Behavior
The text was updated successfully, but these errors were encountered: