-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Update typings for beta.4 and beta.5 #7793
Conversation
- Regenerate enzyme + react typings to fix "subsequent declaration" issue
- Regenerate `yarn.lock` so enzyme and react don't have a "subsequent declaration" issue...
@oliviertassinari The API change in #7740 is super awesome BTW! Loving it 🤗 Also, since we now have tests for the typings. People could just commit snippets that don't work and I could just add them to the existing tests. Would you approve a page in the docs that describes this process? (and maybe some info on how the typings work in general) |
@sebald Yeah, I think that we could document the process somewhere, we have a |
Is this the right place to provide feedback about the typings? If not please let me know what I should do. @sebald It looks like Drawer's docked field only accepts Example I get this error: |
@vyrotek Yes, that's the right place. Thank you for reporting this. Will have a look at it. |
Well, this this is a very weird behaviour. Thought that was fixed in microsoft/TypeScript#10577 Here is a minimal example to reproduce: type One = {
kind: true;
foo: string;
}
type Two = {
kind: false;
foo: boolean;
}
type Options = One | Two;
const fn = (options: Options) => { /* ... */ };
const optionsOne = { kind: true, foo: 'bar' };
/**
* ERROR:
* Types of property 'kind' are incompatible.
* Type 'boolean' is not assignable to type 'false'.
*/
fn(optionsOne);
/**
* No Error.
*/
fn({ kind: true, foo: 'bar' }) |
For now we don't use them, maybe Reason -> microsoft/TypeScript#17882 helps to find a way to make use of them.
I have removed the discriminated unions for now from the typings as they did not work as I expected. Some more info: The whole idea was to use discriminated unions to have a strongly typed API and make some |
Going to merge this for now, so we finally have some typings in the next beta! |
Looks good :) |
Thanks :) |
@sebald How will we know when the typings have been released? |
@marcusjwhelan guess they will be available with the next beta. Check its changelog :) |
ℹ️ I will gather any updated here until Friday and then merge it, so we hopefully have the typings ready for the next beta.
This patch contains the following updates regarding the typings:
<Tabs>
API to match BC introduced in [Tabs][BottomNavigation] Use value over index property #7741withStyle
API to match BC introduced in [core] Remove createStyleSheet #7740true
|false
can not be used to create discriminated unions microsoft/TypeScript#17882)