How to use the @react-navigation/routers.StackActions.push function in @react-navigation/routers

To help you get started, we’ve selected a few @react-navigation/routers 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 / compat / src / StackActions.tsx View on Github external
export function push({
  routeName,
  params,
  action,
}: {
  routeName: string;
  params?: object;
  action?: never;
}): StackActionType {
  if (action !== undefined) {
    throw new Error(
      'Sub-actions are not supported for `push`. Remove the `action` key from the options.'
    );
  }

  return StackActions.push(routeName, params);
}