Skip to content

Commit

Permalink
fix: unnecessary re-render due to useMemo
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Jun 3, 2024
1 parent d233f2c commit c485d05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PrivacyProtection/PrivacyProtection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ const PrivacyProtection = (props) => {
if (!props.height || enabled || !show) return 'auto';
if (isNumber(props.height)) return `${props.height}px`;
return props.height;
}, [props.height, enabled, show]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [enabled, show]);

React.useEffect(() => {
if (bgImg) {
Expand Down

0 comments on commit c485d05

Please sign in to comment.