fix: tweak error message for navigate

This commit is contained in:
Satyajit Sahoo
2020-02-21 19:13:11 +01:00
parent f16700812f
commit c8ea4199f4
2 changed files with 2 additions and 2 deletions

View File

@@ -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.'
);
}

View File

@@ -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.'
);
});