Closed dibenso closed 1 year ago
The current README shows that related components are not part of the parent export:
import { createRoot } from "react-dom/client"; import { Button, Dialog, DialogHeading, DialogDescription, useDialogState, } from "ariakit"; function App() { const dialog = useDialogState(); return ( <> <Button onClick={dialog.toggle}>Open dialog</Button> <Dialog state={dialog}> <DialogHeading>Welcome</DialogHeading> <DialogDescription>Welcome to Reakit!</DialogDescription> </Dialog> </> ); } createRoot(document.getElementById("root")).render(<App />);
It would be nice to import just the parent component of a compound instead of importing the parent component + the child components of that compound.
import { createRoot } from "react-dom/client"; import { Button, Dialog, useDialogState, } from "ariakit"; function App() { const dialog = useDialogState(); return ( <> <Button onClick={dialog.toggle}>Open dialog</Button> <Dialog state={dialog}> <Dialog.Heading>Welcome</Dialog.Heading> <Dialog.Description>Welcome to Reakit!</Dialog.Description> </Dialog> </> ); } createRoot(document.getElementById("root")).render(<App />);
When importing the parent component of a compound, all child components of that parent should be part of that imported object.
Currently no workaround as we are forced to import the desired components of a compound instead of just the parent.
No response
See https://github.com/ariakit/ariakit/issues/894#issuecomment-894523032
Motivation
The current README shows that related components are not part of the parent export:
It would be nice to import just the parent component of a compound instead of importing the parent component + the child components of that compound.
Usage example
Requirements
When importing the parent component of a compound, all child components of that parent should be part of that imported object.
Workaround
Currently no workaround as we are forced to import the desired components of a compound instead of just the parent.
Possible implementations
No response