Components
AnimatePresence
We use the AnimatePresence component from Framer Motion to animate the Ariakit Menu component when it gets mounted and unmounted from the DOM.
<AnimatePresence>
{mounted && (
{children}
)}
</AnimatePresence>
To dynamically render the menu component, you can use the mounted
state that can be retrieved from the store:
You can learn more about reading state from the store on the Component stores guide.