From b5a7302cba7ab22c0997007b2917ca90151e3e4e Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 01:47:34 -0800 Subject: [PATCH] Update components to fix NextJs errors --- components/JobSkillSearchFilterBar/index.tsx | 1 + components/Overlay/index.tsx | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/JobSkillSearchFilterBar/index.tsx b/components/JobSkillSearchFilterBar/index.tsx index 733de115..7370818f 100644 --- a/components/JobSkillSearchFilterBar/index.tsx +++ b/components/JobSkillSearchFilterBar/index.tsx @@ -18,6 +18,7 @@ const JobSkillSearchFilterBar = (props: Props) => { const [currentGroup, setCurrentGroup] = useState(-1) function openSelect() { + // debugger setOpen(!open) } diff --git a/components/Overlay/index.tsx b/components/Overlay/index.tsx index 5559657a..7cd824b3 100644 --- a/components/Overlay/index.tsx +++ b/components/Overlay/index.tsx @@ -11,13 +11,16 @@ const defaultProps = { visible: true, } -const Overlay = ({ - visible: displayed, - open, -}: { - visible: boolean - open: boolean -}) => { +const Overlay = React.forwardRef(function Overlay( + { + visible: displayed, + open, + }: { + visible: boolean + open: boolean + }, + forwardedRef +) { const [visible, setVisible] = useState(open) const classes = classNames({ @@ -43,7 +46,7 @@ const Overlay = ({ } return visible ?
: null -} +}) Overlay.defaultProps = defaultProps