DefinitelyTyped/types/react-native
James Ide 65430a8a7b [react-native] Make requireNativeComponent work with an update to @types/react
4dd9510a50 changed `React.ReactType` to look at entries in the `JSX.IntrinsicElements` map, which caused rendering `React.ReactType<any>` elements to fail. This commit fixes the RN type declarations by returning `any`. We don't care about the actual return type that much -- it's concretely a string but externally, as a user of react-native, you'd want to only use it as a JSX component type and not as a string.

And since it's a string that isn't registered with `JSX.IntrinsicElements`, there's no extra type information (ex: list of valid props) associated with it. Longer term, it might make sense for `@types/react-native` to add native component types like `RCTView` to `JSX.IntrinsicElements` and go back to using `React.ReactType<'RCTView'>` with `requireNativeComponent`, but this is a disruptive change.

Test plan: Ran tests, verified they pass again.

Fixes #30958.
2018-11-30 10:17:33 -08:00
..
test [react-native] Update type definition for requireNativeComponent for 0.57.x 2018-11-27 16:14:26 -08:00
BatchedBridge.d.ts
Devtools.d.ts
globals.d.ts Add declarations for XMLHttpRequest from DOM lib 2018-11-20 15:41:49 -05:00
index.d.ts [react-native] Make requireNativeComponent work with an update to @types/react 2018-11-30 10:17:33 -08:00
legacy-properties.d.ts
tsconfig.json
tslint.json