Invalid DOM property `classname`. Did you mean `className`?
See original GitHub issueInside NextjS env, the following returns an error:
<Interweave
allowAttributes={true}
noWrap={true}
content={`<div className="test">Test</div>`}
/>
Error: “Invalid DOM property classname
. Did you mean className
?”
EDIT: I realize now that although the rendered html includes the expected “class”, the actual css does not get applied. The goal from my end is to insert large content with multiple classNames. These classNames would be defined outside Interweave component such as with styled-jsx
, styled-components
, or even with plain css/sass
. Is this possible?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Unknown DOM property class. Did you mean className ...
When I run the app, I get the following error: Warning: Unknown DOM property class. Did you mean className? I can solve ...
Read more >Invalid DOM property `class` warning in React | bobbyhadz
To fix the React.js warning "Invalid DOM property class . Did you mean className ", use the className prop instead of class on...
Read more >How to fix Unknown DOM property class. Did you mean ...
In this tutorial, we are going to learn about how to solve the Warning: Unknown DOM property class. Did you mean className? in...
Read more >invalid DOM property `class`. Did you mean `className ...
I'm checking my console and I get this warning "Warning: invalid DOM property `class`. Did you mean `className`?" But no where in my...
Read more >Remove Invalid DOM property "class" warning in FilterPanel ...
Warning: Invalid DOM property `class`. Did you mean `className`? in span (at filter-panel.component.js:172) in div (at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@madleo-dk Is this rendering on the server? If so, the SSR situation with Interweave isn’t the best, but you should at least be doing: https://interweave.dev/docs/ssr
But yes, if you’re supplying
className
, then those classes “need to exist” before hand on the client side.Yes, the class “container” gets applied. No worries at all, and appreciate the help.