Skip to content

Commit 7a94577

Browse files
Merge pull request #203 from software-mansion-labs/splits/review-fixes-v3
Splits/review fixes v3
2 parents d0af1d5 + 54fca6a commit 7a94577

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/libs/Navigation/Navigation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,12 @@ function isActiveRoute(routePath: Route): boolean {
148148
}
149149

150150
/**
151+
* Navigates to a specified route.
151152
* Main navigation method for redirecting to a route.
152-
* @param [options] - linkTo function options. They allow to specify if the replace action should be performed.
153+
*
154+
* @param {Route} route - The route to navigate to.
155+
* @param {LinkToOptions} [options] - Optional navigation options.
156+
* @param {boolean} [options.forceReplace] - If true, the navigation action will replace the current route instead of pushing a new one.
153157
*/
154158
function navigate(route: Route, options?: LinkToOptions) {
155159
if (!canNavigate('navigate', {route})) {

tests/perf-test/SidebarLinks.perf-test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jest.mock('../../src/libs/Navigation/navigationRef', () => ({
2323
getState: () => ({
2424
routes: [],
2525
}),
26+
getRootState: () => ({
27+
routes: [],
28+
}),
2629
}));
2730
jest.mock('@components/Icon/Expensicons');
2831

0 commit comments

Comments
 (0)