mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-06-16 05:16:55 +08:00
fix: tweak error message for navigate
This commit is contained in:
@@ -45,7 +45,7 @@ export function navigate(...args: any): Action {
|
||||
|
||||
if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
|
||||
throw new Error(
|
||||
'While calling navigate with an object as the argument, you need to specify name or key'
|
||||
'You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions.html#navigate for usage.'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ import * as CommonActions from '../CommonActions';
|
||||
it('throws if NAVIGATE is called without key or name', () => {
|
||||
// @ts-ignore
|
||||
expect(() => CommonActions.navigate({})).toThrowError(
|
||||
'While calling navigate with an object as the argument, you need to specify name or key'
|
||||
'You need to specify name or key when calling navigate with an object as the argument.'
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user