Skip to content

Commit

Permalink
fix: dimmer can dismiss from parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidetaka Okamoto committed Jun 9, 2020
1 parent 5998645 commit 9e0c2f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DashboardDimmer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useCallback } from 'react';
import React, { useState, useCallback, useEffect } from 'react';
import { Modal } from 'reactstrap';
import Logo from './Logos';

Expand All @@ -8,6 +8,9 @@ type Props = {

export default (props: Props) => {
const [isOpen, updateModalState] = useState(props.isOpen);
useEffect(() => {
updateModalState(props.isOpen);
}, [props.isOpen, updateModalState]);
const toggle = useCallback(() => {
updateModalState(!isOpen);
}, [isOpen, updateModalState]);
Expand Down

0 comments on commit 9e0c2f8

Please sign in to comment.