diff --git a/react/src/HeadlessModal.jsx b/react/src/HeadlessModal.jsx
index a3b1423..d1fd270 100644
--- a/react/src/HeadlessModal.jsx
+++ b/react/src/HeadlessModal.jsx
@@ -73,18 +73,18 @@ const HeadlessModal = forwardRef(({ name, children, ...props }, ref) => {
<>
{typeof children === 'function'
? children({
- afterLeave: modalContext.afterLeave,
- close: modalContext.close,
- emit: modalContext.emit,
- getChildModal: modalContext.getChildModal,
- getParentModal: modalContext.getParentModal,
- index: modalContext.index,
- isOpen: modalContext.open,
- modalContext,
- modalProps,
- reload: modalContext.reload,
- setOpen: modalContext.setOpen,
- })
+ afterLeave: modalContext.afterLeave,
+ close: modalContext.close,
+ emit: modalContext.emit,
+ getChildModal: modalContext.getChildModal,
+ getParentModal: modalContext.getParentModal,
+ index: modalContext.index,
+ isOpen: modalContext.open,
+ modalContext,
+ modalProps,
+ reload: modalContext.reload,
+ setOpen: modalContext.setOpen,
+ })
: children}
{/* Next modal in the stack */}
diff --git a/react/src/ModalRenderer.jsx b/react/src/ModalRenderer.jsx
index 8cbcb25..059905c 100644
--- a/react/src/ModalRenderer.jsx
+++ b/react/src/ModalRenderer.jsx
@@ -20,12 +20,14 @@ const ModalRenderer = ({ index }) => {
}, [stack, index])
return (
- modalContext?.component &&
- modalContext.emit(...args)}
- />
-
+ modalContext?.component && (
+
+ modalContext.emit(...args)}
+ />
+
+ )
)
}
diff --git a/react/src/ModalRoot.jsx b/react/src/ModalRoot.jsx
index db1c605..3ee22b3 100644
--- a/react/src/ModalRoot.jsx
+++ b/react/src/ModalRoot.jsx
@@ -29,9 +29,12 @@ export const ModalStackProvider = ({ children }) => {
return true
}
- return newStack.map((modal) => ({ id: modal.id, shouldRender: modal.shouldRender }))
- .reverse()
- .find((modal) => modal.shouldRender)?.id === modalId
+ return (
+ newStack
+ .map((modal) => ({ id: modal.id, shouldRender: modal.shouldRender }))
+ .reverse()
+ .find((modal) => modal.shouldRender)?.id === modalId
+ )
}
newStack.forEach((modal, index) => {
@@ -57,7 +60,6 @@ export const ModalStackProvider = ({ children }) => {
// Find the first open modal after this one
return newStack.slice(index + 1).find((modal) => modal.open)
}
-
})
return newStack
@@ -259,16 +261,17 @@ export const ModalStackProvider = ({ children }) => {
return modal
}
- const visitModal = (url, options = {}) => visit(
- url,
- options.method ?? 'get',
- options.data ?? {},
- options.headers ?? {},
- options.config ?? {},
- options.onClose,
- options.onAfterLeave,
- options.queryStringArrayFormat ?? 'brackets',
- )
+ const visitModal = (url, options = {}) =>
+ visit(
+ url,
+ options.method ?? 'get',
+ options.data ?? {},
+ options.headers ?? {},
+ options.config ?? {},
+ options.onClose,
+ options.onAfterLeave,
+ options.queryStringArrayFormat ?? 'brackets',
+ )
const visit = (
href,
@@ -305,7 +308,6 @@ export const ModalStackProvider = ({ children }) => {
'X-InertiaUI-Modal-Use-Router': useInertiaRouter ? 1 : 0,
}
-
if (useInertiaRouter) {
// Pushing the modal to the stack will be handled by the ModalRoot...
return router.visit(url, {