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

Unable to use arbitrary attributes #129

Closed
groundedsage opened this issue Mar 30, 2017 · 1 comment
Closed

Unable to use arbitrary attributes #129

groundedsage opened this issue Mar 30, 2017 · 1 comment

Comments

@groundedsage
Copy link

groundedsage commented Mar 30, 2017

So this has been around for a while and has meant I have had to use dangerously setting inner html.

I use netlify and when doing form handling I need to be able to set an element attribute to netlify.
"netlify" true does not work for this. There is also other bits of code on the web which works this way so it would be handy if this could somehow be supported.

UPDATE: Rum handles this serverside when generating the static html as it uses Clojure. However it doesn't do custom attributes on the client side.

@groundedsage
Copy link
Author

Referencing some links shared in the discussion in slack. All links were shared by misha personally haven't had time to review them. Just ensuring it is here as a reference.

Allow custom (nonstandard) attributes (REACT ISSUE). facebook/react#140

https://github.com/facebook/react/blob/b1b4a2fb252f26fe10d29ba60d85ff89a85ff3ec/src/renderers/dom/shared/ARIADOMPropertyConfig.js

https://github.com/facebook/react/blob/b1b4a2fb252f26fe10d29ba60d85ff89a85ff3ec/src/renderers/dom/shared/ReactDOMInjection.js#L63-L65

https://github.com/facebook/react/blob/b1b4a2fb252f26fe10d29ba60d85ff89a85ff3ec/src/renderers/dom/shared/DOMProperty.js#L40-L42

DOMProperty.injectDOMPropertyConfig({
  Properties: { amp: DOMProperty.MUST_USE_ATTRIBUTE },
  isCustomAttribute: attributeName => attributeName.startsWith('amp-')
})

https://github.com/facebook/react/blob/b1b4a2fb252f26fe10d29ba60d85ff89a85ff3ec/src/renderers/dom/shared/SVGDOMPropertyConfig.js#L295-L300

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

1 participant