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

Let's stop attribute blocking! #10126

Closed
trusktr opened this issue Jul 8, 2017 · 3 comments
Closed

Let's stop attribute blocking! #10126

trusktr opened this issue Jul 8, 2017 · 3 comments

Comments

@trusktr
Copy link

trusktr commented Jul 8, 2017

I write this JSX:

<div mesh="sphere" texture="earth.png" r="30" cx="100" cy="100" transform="..."></div>

and I get

Warning: Unknown props `mesh`, `texture` on <div> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop

and React prevents the attributes from appearing in the DOM.

This means React will not always play nice with elements whose behaviors are defined by

  • jQuery
  • Angular
  • etc, other APIs whose routines read from DOM.

In the above example, I could use jQuery or Angular to define routines that observe those attributes, and render a 3D WebGL scene in a separate canvas.

If an author wants to animate the sphere, they will not be able to, and my Angular or jQuery routine will not find the required attributes.

Please uplift this limitation! Don't limit the web!

@trusktr
Copy link
Author

trusktr commented Jul 8, 2017

React says

Remove these props from the element.

Um, but I want those props there. Come on React! Don't be an attribute blocker! Let my attributes be happy.

@trusktr trusktr changed the title Please stop whitelisting attributes for DOM nodes. Stop attribute blocking! Jul 8, 2017
@nhunzaker
Copy link
Contributor

Thank you for sending us your use case for custom attributes! We are working on this. See #7311

I'm going to close this out since we are tracking it here: #9477

But thanks for the write up!

@trusktr
Copy link
Author

trusktr commented Jul 8, 2017

@nhunzaker Great to hear. THanks!

@trusktr trusktr changed the title Stop attribute blocking! Let's stop attribute blocking! Apr 9, 2018
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

2 participants