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.

Invalid DOM property `classname`. Did you mean `className`?

See original GitHub issue

Inside 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:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
milesjcommented, May 25, 2022

@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.

0reactions
zidkimcommented, May 28, 2022

Yes, the class “container” gets applied. No worries at all, and appreciate the help.

Read more comments on GitHub >

github_iconTop 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 >

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