fix: Reordered definitions in providers to prevent uninitialized var access (#2108)

This commit is contained in:
matthiasg authored and GitHub committed 2020-11-02 11:33:16 +01:00
1 parent 330eeaa216
commit 619f361510
3 files changed
+70 -76

No files matched your search

@@ -41,17 +41,6 @@ const ModalProvider = ({ children, modal: Modal, service }) => {
const [options, setOptions] = useState(DEFAULT_OPTIONS);
/**
* Sets the implementation of a modal service that can be used by extensions.
*
* @returns void
*/
useEffect(() => {
if (service) {
service.setServiceImplementation({ hide, show });
}
}, [hide, service, show]);
/**
* Show the modal and override its configuration props.
*
@@ -71,6 +60,17 @@ const ModalProvider = ({ children, modal: Modal, service }) => {
DEFAULT_OPTIONS,
]);
/**
* Sets the implementation of a modal service that can be used by extensions.
*
* @returns void
*/
useEffect(() => {
if (service) {
service.setServiceImplementation({ hide, show });
}
}, [hide, service, show]);
const {
content: ModalContent,
contentProps,