Skip to content

Conversation

@smith-m
Copy link

@smith-m smith-m commented Jun 27, 2023

Please review and merge these changes.
Explanations: migrations/test/react-dnd/react-dnd/packages/test-suite-vite/src/main.tsx:
The changes in this git diff are part of a migration task where ReactDOM.render is replaced with createRoot, a new API for rendering in React.

  1. The import statement for ReactDOM has been replaced with an import statement for createRoot from 'react-dom/client'. This change is because we are no longer using the old ReactDOM.render method and instead we are using the new createRoot for rendering.

  2. Instead of directly calling ReactDOM.render and passing the React element and the root DOM container as arguments, we first find the root DOM node with document.getElementById('root') and store it in the variable container.

  3. Then, we create a root from the DOM container using the createRoot function and store it in the variable root.

  4. Finally, we call the render method on the root object and pass the React element as the argument. This is equivalent to the previous ReactDOM.render call, but is using the new createRoot API.

This change provides a way to opt into a concurrent mode where React will keep your app responsive while rendering complex component trees and handling intensive computations. It's a part of the ongoing React updates aiming to improve the performance and user experience of React apps.

smith-m added 3 commits June 27, 2023 12:38
…rc/main.tsx:

The changes in this git diff are part of a migration task where ReactDOM.render is replaced with createRoot, a new API for rendering in React.

1. The import statement for ReactDOM has been replaced with an import statement for createRoot from 'react-dom/client'. This change is because we are no longer using the old ReactDOM.render method and instead we are using the new createRoot for rendering.

2. Instead of directly calling ReactDOM.render and passing the React element and the root DOM container as arguments, we first find the root DOM node with document.getElementById('root') and store it in the variable `container`.

3. Then, we create a root from the DOM container using the createRoot function and store it in the variable `root`.

4. Finally, we call the render method on the `root` object and pass the React element as the argument. This is equivalent to the previous ReactDOM.render call, but is using the new createRoot API. 

This change provides a way to opt into a concurrent mode where React will keep your app responsive while rendering complex component trees and handling intensive computations. It's a part of the ongoing React updates aiming to improve the performance and user experience of React apps.
…rc/main.tsx:

The changes in this git diff are part of a migration task where ReactDOM.render is replaced with createRoot, a new API for rendering in React.

1. The import statement for ReactDOM has been replaced with an import statement for createRoot from 'react-dom/client'. This change is because we are no longer using the old ReactDOM.render method and instead we are using the new createRoot for rendering.

2. Instead of directly calling ReactDOM.render and passing the React element and the root DOM container as arguments, we first find the root DOM node with document.getElementById('root') and store it in the variable `container`.

3. Then, we create a root from the DOM container using the createRoot function and store it in the variable `root`.

4. Finally, we call the render method on the `root` object and pass the React element as the argument. This is equivalent to the previous ReactDOM.render call, but is using the new createRoot API. 

This change provides a way to opt into a concurrent mode where React will keep your app responsive while rendering complex component trees and handling intensive computations. It's a part of the ongoing React updates aiming to improve the performance and user experience of React apps.
…rc/main.tsx:

The changes in this git diff are part of a migration task where ReactDOM.render is replaced with createRoot, a new API for rendering in React.

1. The import statement for ReactDOM has been replaced with an import statement for createRoot from 'react-dom/client'. This change is because we are no longer using the old ReactDOM.render method and instead we are using the new createRoot for rendering.

2. Instead of directly calling ReactDOM.render and passing the React element and the root DOM container as arguments, we first find the root DOM node with document.getElementById('root') and store it in the variable `container`.

3. Then, we create a root from the DOM container using the createRoot function and store it in the variable `root`.

4. Finally, we call the render method on the `root` object and pass the React element as the argument. This is equivalent to the previous ReactDOM.render call, but is using the new createRoot API. 

This change provides a way to opt into a concurrent mode where React will keep your app responsive while rendering complex component trees and handling intensive computations. It's a part of the ongoing React updates aiming to improve the performance and user experience of React apps.
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.

2 participants