question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chakra 1.0.0-rc.5 - Framer-Motion - Warning: React does not recognize the `whileHover` prop on a DOM element.

See original GitHub issue

Bug report

Describe the bug

Using the Documentation Guide in order to use Chakra and Framer Motion gives console warnings (however, the animations works as expected)

Warning: React does not recognize the whileHover prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase whilehover instead. If you accidentally passed it from a parent component, remove it from the DOM element. in div (created by Context.Consumer) in Box (created by ForwardRef(MotionComponent)) in ForwardRef(MotionComponent) (at App.js:11) in App (at src/index.js:9) in StrictMode (at src/index.js:8)

Warning: React does not recognize the dragConstraints prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase dragconstraints instead. If you accidentally passed it from a parent component, remove it from the DOM element. in div (created by Context.Consumer) in Box (created by ForwardRef(MotionComponent)) in ForwardRef(MotionComponent) (at App.js:11) in App (at src/index.js:9) in StrictMode (at src/index.js:8)

To reproduce

Use the Chakra documentation Framer-motion guide, that minimal sample already shows the error, below a sandbox

Minimal reproduction

https://codesandbox.io/s/chakra-framer-motion-error-whq5x?file=/src/App.js

System information

  • Browser (if applies): [e.g. Chrome, Safari]
  • Version of @chakra-ui/core: [e.g. 1.0.0-rc.5]

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
TimKolbergercommented, Nov 23, 2020

See #2538

1reaction
smontlouiscommented, Nov 23, 2020

@oahmaro Did you fix the issue ? It looks like there are two solutions with their own drawback:

  • const MotionBox = motion.custom(Box); with errors in the console
  • const MotionBox = chakra(motion.div); with transition not working.
Read more comments on GitHub >

github_iconTop Results From Across the Web

React does not recognize the X prop on a DOM element ...
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >
Unknown Prop with Framer Motion and React : r/webdev
I'm trying to use Framer Motion to animate Reach UI's dialog component, ... React does not recognize the `layoutId` prop on a DOM...
Read more >
Chakra UI + Framer Motion
The chakra factory function can be used to represent animation and interaction using framer motion props, as in the example below.
Read more >
chakra-ui-framer-motion-example - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >
framer-motion motion TypeScript Examples - ProgramCreek.com
MotionBox = motion.custom( forwardRef((props, ref) => { const chakraProps = Object.fromEntries( // do not pass framer props to DOM element ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found