How to use the react-native-screens.screensEnabled function in react-native-screens

To help you get started, we’ve selected a few react-native-screens examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-navigation / navigation-ex / packages / bottom-tabs / src / views / ResourceSavingScene.tsx View on Github external
render() {
    if (screensEnabled?.()) {
      const { isVisible, ...rest } = this.props;
      // @ts-ignore
      return ;
    }

    const { isVisible, children, style, ...rest } = this.props;

    return (
github react-navigation / navigation-ex / packages / drawer / src / views / ResourceSavingScene.tsx View on Github external
render() {
    if (screensEnabled?.()) {
      const { isVisible, ...rest } = this.props;

      // @ts-ignore
      return ;
    }
    const { isVisible, children, style, ...rest } = this.props;

    return (
github react-navigation / navigation-ex / packages / stack / src / views / Stack / CardStack.tsx View on Github external
const MaybeScreen = ({
  enabled,
  active,
  ...rest
}: ViewProps & {
  enabled: boolean;
  active: number | Animated.Node;
  children: React.ReactNode;
}) => {
  if (Platform.OS !== 'ios' && enabled && Screens.screensEnabled()) {
    AnimatedScreen =
      AnimatedScreen || Animated.createAnimatedComponent(Screens.NativeScreen);

    return ;
  }

  return
github react-navigation / navigation-ex / packages / native-stack / src / navigators / createNativeStackNavigator.tsx View on Github external
function NativeStackNavigator(props: NativeStackNavigatorProps) {
  if (!screensEnabled()) {
    throw new Error(
      'Native stack is only available if React Native Screens is enabled.'
    );
  }

  const { initialRouteName, children, screenOptions, ...rest } = props;
  const { state, descriptors, navigation } = useNavigationBuilder<
    StackNavigationState,
    StackRouterOptions,
    NativeStackNavigationOptions,
    {}
  >(StackRouter, {
    initialRouteName,
    children,
    screenOptions,
  });
github react-navigation / stack / src / views / Stack / Stack.tsx View on Github external
const MaybeScreen = ({
  enabled,
  active,
  ...rest
}: ViewProps & {
  enabled: boolean;
  active: number | Animated.Node;
  children: React.ReactNode;
}) => {
  if (Platform.OS !== 'ios' && enabled && Screens.screensEnabled()) {
    AnimatedScreen =
      AnimatedScreen || Animated.createAnimatedComponent(Screens.NativeScreen);

    return ;
  }

  return