Skip to content

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

Closed
dfrankland wants to merge 3 commits intofacebook:masterfrom
dfrankland:non-standard-react-dom-server-render
Closed

Add non-standard allowing variants of ReactDOMServer render methods (fixes #10064)#12568
dfrankland wants to merge 3 commits intofacebook:masterfrom
dfrankland:non-standard-react-dom-server-render

Conversation

@dfrankland
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown

L42y commented Sep 5, 2018

Any progress on this PR?

@dfrankland
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

@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.

6 participants