-
Notifications
You must be signed in to change notification settings - Fork 6
Migration path from current DefinitelyTyped RN typings #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
Comments
We should consider providing a codemod that users can apply to their codebase to upgrade some/all of these. |
Perhaps we can find a way to alias TS doesn't need to resolve specific extensions, as currently we’re generating distinctive sets per platform and dropping the platform file extension.
Additionally we could update the actual |
Could it help if we were able to release DT packages with version suffix? E.g. |
Also need to decide what to do with fallout in all DT packages that depend on the RN typings, assuming there will be. |
One solution to providing the packages using alternate names would be to use |
Looks like TypeScript people are working on supporting this scenario |
Uh oh!
There was an error while loading. Please reload this page.
This ticket describes the differences with the existing manually maintained DT typings and the migration path to these converted ones.
TypeScript does not have a build in way to deal with different files for different platforms. Proposal: Allow typescript to type check modules using react-native's module resolution TypeScript#21926
@types/react-native-ios
,@types/react-native-android
) and let the user configure them for their project?Many (all?) components are no longer class based, but rather function or even ‘abstract’ based. Because classes can be used as types in TS, there may be user code that refers to it that way but now needs to change to
typeof View
. This does not seem like an issue we need to resolve, as it’s simply not in line with reality.TS2749
Component props interfaces are exported, whereas upstream Flow code requires the user to do
React.ElementProps<typeof View>
. We currently export these separate props types as a migration convenience, but they are annotated as being deprecated.ElementProps
to the React DT typings and is it correct thatElementProps
does not includeref
(as we useComponentPropsWithoutRef
of the React DT typings)?Allow interface merging of RN
NativeModules
. These contain the user's own and 3rd party native modules and so should allow for the user to provide typings. f41628cStyle type param passed to
StyleSheet.create<T>(…)
needs to by atype
alias, not an interface; because Index signature is missing in type (only on interfaces, not on type alias) TypeScript#15300 (comment). But also there's no longer a need to define the type upfront anymore (which perhaps was already no longer needed).The text was updated successfully, but these errors were encountered: