Skip to content

Instantly share code, notes, and snippets.

@gangstaJS
Created April 3, 2020 08:21
Show Gist options
  • Save gangstaJS/7da5d9750b90bf703637f6929770ecf7 to your computer and use it in GitHub Desktop.
Save gangstaJS/7da5d9750b90bf703637f6929770ecf7 to your computer and use it in GitHub Desktop.
import { dialogToggle } from 'componentversions/organizer/modules/ui-helpers';
import {useSelector, useDispatch} from 'react-redux';
const Screen = () => {
const diapatch = useDispatch();
const {dialogs} = useSelector((state) => ({dialogs: state.uiHelpers.dialogs}));
return <div>
<button onClick={() => diapatch(dialogToggle('myCustomDialog', true))}>Open dialog</button>
{dialogs.myCustomDialog.visible && <Dialog/>}
</div>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment