#6: Use new root API and legacy root API together, 2021
It’s always been difficult to use two versions of React in a single app. This makes upgrading difficult because it requires a full, up-front migration. And that can take months to get right.
React 18 prizes gradual adoption. So we can render different component trees with different rendering strategies.
We can use both new and legacy root APIs on the same page.
We can also conditionally use a root API based on segmentation or environment:
With React 18, we don’t change our entire app at once. And — without much trouble — we can manage a staged rollout to users.
P.S. How have you handled upgrades with previous versions? Hit reply or join the conversation in the Lunch Dev Discord Server.