Skip to content

Commit 6095993

Browse files
authored
Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>> (#17265)
* Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>> * Prettier
1 parent 62ef250 commit 6095993

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
4545

4646
function findHostInstance_DEPRECATED(
4747
componentOrHandle: any,
48-
): ?HostComponent<mixed> {
48+
): ?React$ElementRef<HostComponent<mixed>> {
4949
if (__DEV__) {
5050
const owner = ReactCurrentOwner.current;
5151
if (owner !== null && owner.stateNode !== null) {

packages/react-native-renderer/src/ReactNativeRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
4949

5050
function findHostInstance_DEPRECATED(
5151
componentOrHandle: any,
52-
): ?HostComponent<mixed> {
52+
): ?React$ElementRef<HostComponent<mixed>> {
5353
if (__DEV__) {
5454
const owner = ReactCurrentOwner.current;
5555
if (owner !== null && owner.stateNode !== null) {

packages/react-native-renderer/src/ReactNativeTypes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ type SecretInternalsFabricType = {
141141
*/
142142
export type ReactNativeType = {
143143
NativeComponent: typeof ReactNativeComponent,
144-
findHostInstance_DEPRECATED(componentOrHandle: any): ?HostComponent<mixed>,
144+
findHostInstance_DEPRECATED(
145+
componentOrHandle: any,
146+
): ?ElementRef<HostComponent<mixed>>,
145147
findNodeHandle(componentOrHandle: any): ?number,
146148
dispatchCommand(handle: any, command: string, args: Array<any>): void,
147149
render(

0 commit comments

Comments
 (0)