import React, { PropsWithChildren } from 'react'; import { View } from 'react-native'; import { ScreenProps, ScreenContext } from 'react-native-screens'; import ReanimatedNativeStackScreen from './ReanimatedNativeStackScreen'; import AnimatedScreen from './ReanimatedScreen'; class ReanimatedScreenWrapper extends React.Component { private ref: React.ElementRef | null = null; setNativeProps(props: ScreenProps): void { this.ref?.setNativeProps(props); } setRef = (ref: React.ElementRef | null): void => { this.ref = ref; this.props.onComponentRef?.(ref); }; render() { const ReanimatedScreen = this.props.isNativeStack ? ReanimatedNativeStackScreen : AnimatedScreen; return ( ); } } export default function ReanimatedScreenProvider( props: PropsWithChildren ) { return ( // eslint-disable-next-line @typescript-eslint/no-explicit-any {props.children} ); }