Skip to content

Commit

Permalink
Merge pull request #20155 from Expensify/alberto-null
Browse files Browse the repository at this point in the history
Add null check before react effect
  • Loading branch information
mountiny authored Jun 5, 2023
2 parents ce4ecbb + b609752 commit f08d2fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ const defaultProps = {

const OptionRowLHN = (props) => {
const optionItem = SidebarUtils.getOptionData(props.reportID);
const isPinned = _.get(optionItem, 'isPinned', false);

React.useEffect(() => {
ReportActionContextMenu.hideContextMenu(false);
}, [optionItem.isPinned]);
}, [isPinned]);

if (!optionItem) {
return null;
Expand Down

0 comments on commit f08d2fb

Please sign in to comment.