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

[FIX] Replace React.DOM render with createRoot #174

Merged
merged 11 commits into from
Sep 11, 2024

Conversation

luluiz
Copy link
Member

@luluiz luluiz commented Sep 9, 2024

User-Facing Changes

N/A

Description
It was removed from the deprecated React.DOM and replaced by createRoot.
It removed StrictMode as it caused duplicate execution in the application's dialog.

Checklist

  • The web version was tested and it is running ok
  • The desktop version was tested and it is running ok

Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
@luluiz luluiz changed the title Fix/replace reactdom render with createroot [FIX] Replace React.DOM render with createRoot Sep 9, 2024
@luluiz luluiz added the bug Something isn't working label Sep 9, 2024
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Copy link
Collaborator

@laisspportugal laisspportugal left a comment

Choose a reason for hiding this comment

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

There is an error when running the web application when using this branch.
Can you please take a look on that?
image

Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
…rker

Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
@luluiz
Copy link
Member Author

luluiz commented Sep 10, 2024

There is an error when running the web application when using this branch. Can you please take a look on that?

Since we started using the concurrent model applied by React's createRoot, I needed to adapt the Chart component's update behaviour to wait for the next cycle using queueMicrotask, which has better performance than setTimeout in this type of scenario.

Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Signed-off-by: Luiz Bezerra <luiz.bezerra@ctw.bmwgroup.com>
Copy link
Collaborator

@aneuwald-ctw aneuwald-ctw left a comment

Choose a reason for hiding this comment

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

LGTM. Liked the "queueMicrotask"

@luluiz luluiz merged commit aaba18d into main Sep 11, 2024
8 checks passed
@luluiz luluiz deleted the fix/replace-reactdom-render-with-createroot branch September 11, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants