Reputation: 31
So I want to add an image in componentDidMount like this:
document.getElementById('d3_16').innerHTML = `<img src=${damsel}
className="npcSprite" />`
Everything shows up correctly, class in inspector seems to be assigned however the styles dont apply, while other elements created normally have their styles loaded properly.
How can i fix this?
Upvotes: 0
Views: 403
Reputation: 7407
You should use class
instead of className
since it is just plain HTML and not JSX.
Upvotes: 2