Automattic / Automattic/woocommerce-services

We need to use `createRoot` instead of `render`

Open
#2,797 3 comments 0 reactions 0 assignees View on GitHub
[Status] Blocked [Type] Technical Debt woocommerce-services
Dominant language
JavaScript
Stars
112
Forks
31
Avg merge
3d 1h
Merged PRs (30d)
14

Description

We need to update our React entrypoint logic to use `createRoot` instead of `ReactDOM.render` (see screenshot below):

![Screenshot 2024-08-14 at 12 48 38](https://github.com/user-attachments/assets/a5b5a283-f6d4-43af-b8b5-634c05d2d5ef)

* [Places where we use `ReactDOM.render`](https://github.com/search?q=repo%3AAutomattic%2Fwoocommerce-services%20ReactDOM.render&type=code): `/client/main.js`
* Solution inspiration: https://github.com/woocommerce/woocommerce/pull/48831

Contributor guide

Open the contributing guide

Research direction

Start in /client/main.js, the entrypoint identified as the only place using ReactDOM.render. Read the React createRoot API and compare the solution approach in woocommerce/woocommerce#48831. Done means the entrypoint uses createRoot instead of ReactDOM.render and the application still mounts normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.