+
Skip to content

Conversation

kylemellander
Copy link
Contributor

Summary

React 18 is changing the way that client-side components are rendered and hydrated. See reactwg/react-18#5

In order to create a path forward to using React 18, this adds support for both methods of hydrating and rendering so that newer React features can be used while maintaining full backward compatibility.

Other Information

I did not add any specific tests for this because there was no clear way to test for different versions of React. This seems like it should be explored in separately.

With React 18, the rendering interface will be updated in order to benefit from new features. reactwg/react-18#5

This allows React 18 rendering to be supported while creating backwards compatibility.

For the time being, the return of the components does not change the output from the previous versions so as to not cause any breaking changes.
Copy link
Member

@BookOfGreg BookOfGreg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a second to understand why legacyReactRootLike was written the way it was, its clever. 👍

@BookOfGreg BookOfGreg merged commit ed13a3e into reactjs:master Dec 19, 2021
@kylemellander kylemellander deleted the react-18-prep branch December 20, 2021 18:15
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

Successfully merging this pull request may close these issues.

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载