Getting a React warning for a prop I am trying to pass to a styled component #830
Unanswered
richard-chang-coder
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
error
app-index.js:31 Warning: React does not recognize the
darkModeprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase
darkmodeinstead. If you accidentally passed it from a parent component, remove it from the DOM element.
Menu.jsx
return ( <FullScreenMenu isMegaMenuVisible={isMegaMenuVisible} darkMode={darkMode} ></FullScreenMenu> )
FullScreenMenu.jsx
`
'use client'
import tw, { styled } from 'twin.macro'
const FullScreenMenu = styled.div(({ isMegaMenuVisible, darkMode }) => [
// The common button styles added with the tw import
tw'fixed top-0 left-0 z-[5] w-full h-screen bg-white ',
])
export default FullScreenMenu
`
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions