Skip to content

Commit

Permalink
update hopper provider
Browse files Browse the repository at this point in the history
  • Loading branch information
alexasselin008 committed May 7, 2024
1 parent 32e1803 commit 43374e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/components/src/HopperProvider/src/HopperProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface HopperProviderProps extends StyledSystemProviderProps {
* );
* }
*/
navigate: (path: Href, routerOptions: RouterOptions | undefined) => void;
navigate?: (path: Href, routerOptions: RouterOptions | undefined) => void;
/**
* useHref is an optional prop that converts a router-specific href to a native HTML href, e.g. prepending a base path.
* @example
Expand Down Expand Up @@ -59,6 +59,7 @@ const HopperProvider = (props:HopperProviderProps, ref: ForwardedRef<HTMLDivElem
withCssVariables = true,
className,
navigate,
useHref,
...rest
} = props;

Expand All @@ -69,7 +70,7 @@ const HopperProvider = (props:HopperProviderProps, ref: ForwardedRef<HTMLDivElem

let content = children;
if (navigate) {
content = <RouterProvider navigate={navigate}>{children}</RouterProvider>;
content = <RouterProvider navigate={navigate} useHref={useHref}>{children}</RouterProvider>;
}

return (
Expand Down

0 comments on commit 43374e6

Please sign in to comment.