4 ms·
For the default props side of things, as of typescript 3 and the latest @types/react it should work as you would expect: https://github.com/Microsoft/TypeScrip
by Alexendoo 8y ago
For the default props side of things, as of typescript 3 and the latest @types/react it should work as you would expect:
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#support-for-defaultprops-in-jsx https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in...
- a_humean 8y agoI saw that for default props, but can I use it yet? The React typescript definitions are still on 2.8 [1], and I imagine that they plan to stick with 2.8 until maybe the next major react release? I have no idea where people discuss things like react types for DefinitelyTyped. Github issues seem like a mess due to the sheer number of different projects sitting in a single repo. [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1d9679b2dcf7c9643d623b626c0820f84eaa8d7e/types/react/index.d.ts#L22 https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1d96...
- Alexendoo 8y agoYeah you should be able to, the minimum typescript version required and the one they test at is 2.8 for now but the LibraryManagedAttributes type is present [1]. On 2.8 and 2.9 it has no effect but if you're using 3.0 you should see it working. [1] https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1d9679b2dcf7c9643d623b626c0820f84eaa8d7e/types/react/index.d.ts#L2309 https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1d96...