From 6e40cb9065faf39ec5ca9bcbc5299e70c696aac6 Mon Sep 17 00:00:00 2001 From: Sammy Au <69769431+samau3@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:45:07 -0800 Subject: [PATCH] [Closes #143] Resolve `defaultProp` and required prop warnings (#159) * Remove use of defaultProps and replace with default values * Resolve undefined role prop warning * Format files --- client/src/App.jsx | 18 +++++++++++------- client/src/stories/Header/Header.jsx | 5 +---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/client/src/App.jsx b/client/src/App.jsx index 7e9d7b51..ad4adc5e 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -146,13 +146,17 @@ function App() { - - + user ? ( + + + + ) : ( + + ) } /> diff --git a/client/src/stories/Header/Header.jsx b/client/src/stories/Header/Header.jsx index ab8283d0..8d7a8b1b 100644 --- a/client/src/stories/Header/Header.jsx +++ b/client/src/stories/Header/Header.jsx @@ -18,7 +18,7 @@ import { Sidebar } from '../../components/Sidebar/Sidebar'; * Buttons for logged out buttons * @param {PropTypes.InferProps} props */ -export function Header({ user }) { +export function Header({ user = null }) { const [drawerOpened, { toggle: toggleDrawer, close: closeDrawer }] = useDisclosure(false); @@ -74,9 +74,6 @@ const headerProps = { }; Header.propTypes = headerProps; -Header.defaultProps = { - user: null, -}; const loggedOutButtonsProps = {};