Skip to content

Commit e1c4774

Browse files
NdibeRaymondNdibe Raymond Olisaemeka
andauthored
fix navbar bug (#1123)
Co-authored-by: Ndibe Raymond Olisaemeka <[email protected]>
1 parent 1930012 commit e1c4774

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zubhub_frontend/zubhub/src/views/PageWrapper.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ function PageWrapper(props) {
114114
// useLocation in every component that needs them.
115115
// React.cloneElement makes our code brittle: see https://react.dev/reference/react/cloneElement
116116
const childrenRenderer = () =>
117-
React.Children.map(props.children, child => React.cloneElement(child, { ...routeProps, ...props }));
117+
React.Children.map(props.children, child => React.cloneElement(child, { ...props, ...routeProps }));
118118
return (
119119
<>
120120
<ToastContainer />
121121
<CssBaseline />
122122

123123
<Toolbar ref={backToTopEl} className={classes.marginBottom} />
124-
<Navbar {...props} />
124+
<Navbar {...props} {...routeProps} />
125125

126126
<Container className={classes.childrenContainer} maxWidth="lg">
127127
{props.auth?.token ? <DashboardLayout>{loading ? <LoadingPage /> : childrenRenderer()}</DashboardLayout> : null}

0 commit comments

Comments
 (0)