[BUG] Can't import the named export 'Children' from non EcmaScript module (only default export is available)
See original GitHub issue1. Read the FAQs š
2. Describe the bug ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs Canāt import the named export āChildrenā from non EcmaScript module (only default export is available)
Give a clear and concise description of what the bug is.
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
A CodeSandbox minimal reproduction will allow us to quickly follow the reproduction steps. Without one, this bug report wonāt be accepted.
4. Steps to reproduce Run npm install framer-motion import { motion } from āframer-motionā run npm start Steps to reproduce the behavior:
- Go to āā¦ā
- Click on āā¦ā
- Scroll down to āā¦ā
- See error
5. Expected behavior
A clear and concise description of what you expected to happen.
6. Video or screenshots
If applicable, add a video or screenshots to help explain the bug.
7. Environment details
If applicable, let us know which OS, browser, browser version etc youāre using.
FAQs
Type error with AnimateSharedLayout
AnimateSharedLayout
was deprecated in 5.0. Refer to the upgrade guide for instructions on how to remove.
Preact isnāt working
Framer Motion isnāt compatible with Preact.
AnimatePresence
isnāt working
Have all of its immediate children got a unique key
prop that remains the same for that component every render?
// Bad: The index could be given to a different component if the order of items changes
<AnimatePresence>
{items.map((item, index) => <Component key={index} />)}
</AnimatePresence>
// Good: The item ID is unique to each component
<AnimatePresence>
{items.map((item, index) => <Component key={item.id} />)}
</AnimatePresence>
Is the AnimatePresence
correctly outside of the controlling conditional? AnimatePresence
must be rendered whenever you expect an exit
animation to run - it canāt do so if itās unmounted!
// Bad: AnimatePresence is unmounted - exit animations won't run
{isVisible && (
<AnimatePresence>
<Component />
</AnimatePresence>
)}
// Good: Only the children are unmounted - exit animations will run
<AnimatePresence>
{isVisible && <Component />}
</AnimatePresence>
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:25
Top GitHub Comments
Fixed this by changing import to " import {AnimatePresence, motion} from āframer-motion/dist/framer-motionā; "
When I use
framer-motion/dist/framer-motion
I get typescript errors ā¦