Skip to content

Commit

Permalink
use fn for setState
Browse files Browse the repository at this point in the history
  • Loading branch information
seungpark committed Jan 12, 2024
1 parent 5f47ef8 commit fb27f20
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/Figure/Lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ const Lightbox = ({ nodeData, ...rest }) => {
const [open, setOpen] = useState(false);
const figureWidth = nodeData.options?.figwidth || 'auto';
const openModal = useCallback(() => {
setOpen(!open);
// eslint-disable-next-line react-hooks/exhaustive-deps
setOpen((prevOpen) => !prevOpen);
}, []);

return (
Expand Down

0 comments on commit fb27f20

Please sign in to comment.