extractScreenProps

ScreenProps? extractScreenProps(

  1. JSObject props
)

Extract ScreenProps from JSObject props passed to screen components.

Returns null if props don't contain valid navigation/route objects.

Implementation

ScreenProps? extractScreenProps(JSObject props) {
  final nav = props['navigation'];
  final route = props['route'];
  return switch ((nav, route)) {
    (final JSObject n, final JSObject r) => (
      navigation: NavigationProp._(n),
      route: RouteProp._(r),
    ),
    _ => null,
  };
}