Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
fix: fix types for resetRoot to accept undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 7, 2019
1 parent b5d9ad9 commit e871fdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/NavigationContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const Container = React.forwardRef(function NavigationContainer(
};

const resetRoot = React.useCallback(
(state: PartialState<NavigationState> | NavigationState) => {
(state?: PartialState<NavigationState> | NavigationState) => {
trackAction('@@RESET_ROOT');
setNavigationState(state);
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ type NavigationHelpersCommon<
*
* @param state Navigation state object.
*/
resetRoot(state: PartialState<NavigationState> | NavigationState): void;
resetRoot(state?: PartialState<NavigationState> | NavigationState): void;

/**
* Go back to the previous route in history.
Expand Down Expand Up @@ -549,7 +549,7 @@ export type NavigationContainerRef =
*
* @param state Navigation state object.
*/
resetRoot(state: PartialState<NavigationState> | NavigationState): void;
resetRoot(state?: PartialState<NavigationState> | NavigationState): void;
getRootState(): NavigationState;
}
| undefined
Expand Down

0 comments on commit e871fdb

Please sign in to comment.