-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React error when using Drawer.Stack and Drawer with compound components #7330
Comments
@Pirulax The error message you shared seems to be a warning message. Ideally, you can ignore this message. When using the mantine/packages/@mantine/core/src/components/Drawer/Drawer.tsx Lines 76 to 87 in d19c5cb
When you use the mantine/packages/@mantine/core/src/components/Drawer/DrawerRoot.tsx Lines 113 to 125 in 97eb4d4
Below is a workaround to avoid seeing the warning message. I know it not elegant solution but a quick work around to avoid seeing warning messages. function Demo() {
const stack = useDrawersStack([
"delete-page",
"confirm-action",
"really-confirm-action",
]);
const stackProps = { ...stack.register("delete-page") };
return <>
<Drawer.Stack>
<Drawer.Root opened={stackProps} onClose={stackProps.onClose}>
{/* {...code} */}
</Drawer.Root>
</Drawer.Stack>
<Button variant="default" onClick={() => stack.open("delete-page")}>
Open drawer
</Button>
</>
} To avoid seeing warning messages like this you can try this solution here, this can disable the warning messages you saw. Please note that I haven't tested the changes. These changes can be enabled on the Mantine library itself or on your project itself. A better solution would be to avoid passing unknown props to React components. There might be a better solution which others might suggest. |
To me it seems like as if the |
Drawer.Stack component does not work with compound Drawer components, it is mentioned in the documentation - https://mantine.dev/core/drawer/#drawerstack. It is not planned to add support for this feature, as it impacts multiple parts of the component which you render on your side. |
I'm sorry, you're right. |
Dependencies check up
What version of @mantine/* packages do you have in package.json?
^7.15.
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
Chrome
Describe the bug
When using a drawer built with compound components, the following error appears:
Though, everything seems to work just fine.
When using
Drawer.Stack
+ simpleDrawer
(not with compound components), there are no errors.The repro below is basically the code from mantine.dev, but edited so that one of the 3 drawers is made up using compund components.
If possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/mantine-v7-forked-zhtqt7?workspaceId=ws_D7hskDRdDhrJSNVE9PXVxw
Possible fix
No response
Self-service
The text was updated successfully, but these errors were encountered: