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.

className prop not working with custom DOM elements in 0.14.0-rc1

See original GitHub issue

The className prop does not appear to get mapped correctly when applied to custom DOM elements in 0.14.0-rc1.

JSFiddle: https://jsfiddle.net/hellosmithy/5pdujnfq/1/

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:61 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
syranidecommented, Sep 22, 2015

It works if you set class instead.

cc @jimfb perhaps? (#3067 is related I assume)

1reaction
mikeyboxcommented, Dec 9, 2015

@jimfb what we’re already seeing is that the change between standard DOM elements and custom element behaviour is counter intuitive and thats the point being made. You’d assume currently that using className would output class because thats what happens everywhere else. Suddenly the behaviour changes because of a dash in the element name which is arbitrary. You’re assuming that the use of a dash means I want to create a web component that is going to have special handling of attributes. It’s currently counter intuitive which is why it keeps going around in circles. It seems like the extensive whitelisting is a result of the behaviour change added to custom elements where all props are mapped.

It’s clear we all care about this stuff because react is probably the coolest framework around and we use it every day. So yeah people are going to get passionate about it because its so important. Whats important especially to us is the use of custom elements as standard html elements using the current 0.13 behaviour that had no prejudice between elements. All were equal. What we’re saying is that the non-equality proposed should be done using a setAttr rather than the current behaviour forking which seems wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Giving a className to a custom React component not ...
In OptionsMenu component you can use this prop and apply it as a className on a html DOM element (div/span etc). Or, in...
Read more >
React v0.14 Release Candidate – React Blog
We're happy to announce our first release candidate for React 0.14! We gave you a sneak peek in July at the upcoming changes...
Read more >
react-flip-move
This module was built to tackle the common but arduous problem of animating a list of items when the list's order changes.
Read more >
Learn Raw React — no JSX, no Flux, no ES6, no Webpack…
This becomes a problem when React goes to re-render those elements, as it cannot tell one from another – and thus doesn't know...
Read more >
CHANGELOG.md
Here are some highlights ✨: - Fix some important issues with the Modal ... `@material-ui/lab@v3.0.0-alpha.20` - [SpeedDialAction] Fix className prop ...
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