Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Id selection #125

Closed
chenglou opened this issue Jun 26, 2013 · 3 comments
Closed

Id selection #125

chenglou opened this issue Jun 26, 2013 · 3 comments
Assignees

Comments

@chenglou
Copy link
Contributor

Did a search and didn't find any related issue, so here I go:
Apparently react, as of today, still hijacks the DOM element id (haven't gotten the chance to try it yet), rendering it a bit unpractical for CSS. I was wondering why this rather than using an attribute like data-react-uid. Is this a performance/compatibility issue? What's the motivation behind using the id internally to target elements instead of an attribute?

Sure, it's still possible to use classes, bit I think one less quirky gotcha like this would make react much more appealing.

@ghost ghost assigned benjamn Jun 26, 2013
@benjamn
Copy link
Contributor

benjamn commented Jun 26, 2013

You're right!

I've been working on this problem recently, and I'm very close to a solution that will allow ATTR_NAME to be changed at will in this file: https://github.com/facebook/react/blob/a9b024330c/src/core/ReactID.js#L24

My plan was to use data-reactid, which is almost identical to your suggestion.

@hojberg
Copy link
Contributor

hojberg commented Jun 26, 2013

+1

@benjamn
Copy link
Contributor

benjamn commented Jun 26, 2013

This is in! 67cf44e

@benjamn benjamn closed this as completed Jun 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants