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

Add non-standard allowing variants of ReactDOMServer render methods (fixes #10064) #12568

Conversation

dfrankland
Copy link

@dfrankland dfrankland commented Apr 7, 2018

Adds 4 new methods to ReactDOMServer:

  • renderToStringNonStandard
  • renderToStaticMarkupNonStandard
  • renderToNodeStreamNonStandard
  • renderToStaticNodeStreamNonStandard

Each mirrors the existing:

  • renderToString
  • renderToStaticMarkup
  • renderToNodeStream
  • renderToStaticNodeStream

This allows for rendering markup that may not adhere to W3C standards, yet still works in browsers (like AMP html).

dfrankland added a commit to dfrankland/react-amphtml that referenced this pull request Apr 7, 2018
this shouldn't throw warnings, otherwise this won't work with React normally even if this test passes; see facebook/react#12568
@gaearon
Copy link
Collaborator

gaearon commented Apr 8, 2018

This is a big API addition and we ask that those go through the RFC process: https://github.com/reactjs/rfcs

@L42y
Copy link

L42y commented Sep 5, 2018

Any progress on this PR?

@dfrankland
Copy link
Author

@L42y we'll need to create an RFC before proceeding on this PR. If you, or anyone else for that matter, can help create the RFC, I would be very grateful 👍

@westonruter
Copy link

westonruter commented Sep 5, 2018

This allows for rendering markup that may not adhere to W3C standards, yet still works in browsers (like AMP html).

Is this a reference to the amp-bind bracketed attribute syntax? There is now an XML-compatible syntax, so you can do data-amp-bind-foo="bar" as an alternative to [foo]="bar". See ampproject/amphtml#11115 and ampproject/amphtml#15408.

@tannerbaum
Copy link

@westonruter Am I mistaken or is this still not documented anywhere? Because I tried it out and it appears to work to me which is very handy.

@westonruter
Copy link

@THoisington You're right. I don't think docs have been made for this yet. I've opened a PR: ampproject/amphtml#19835

PrettyBabyMiki added a commit to PrettyBabyMiki/react-example that referenced this pull request Apr 3, 2023
this shouldn't throw warnings, otherwise this won't work with React normally even if this test passes; see facebook/react#12568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants