segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.39k stars 832 forks source link

React 18 support #1458

Closed brandongregoryscott closed 2 years ago

brandongregoryscott commented 2 years ago

Overview

Resolves #1453

I wanted to move the two @types packages that are in our production dependency list, but I'm honestly not sure how to test to see if they are required for our index.d.ts yet (i.e. if anything breaks for an end-user if we don't ship with those types). I imagine if those types are needed because we're referencing them in some of our own type definitions, we could specify @types/react as a peer dependency instead, but that might be a problem for another day.

I pulled in a local version of the package in app and it seems to run fine (no console warning since we're on an older version of React).

In a React v18 app, it will still produce the warning for now.

ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it’s running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

Screenshots (if applicable)

Documentation

netlify[bot] commented 2 years ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit 487f8629c0b489f8a6fffdb61ccea167ed3366ad
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/62b1e126cf10dc0008109565
Deploy Preview https://deploy-preview-1458--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

brandongregoryscott commented 2 years ago

Drafting this - until we update the way we're rendering rendering the Tooltip w/ the new recommended createRoot function, React v18 users are going to get the same warning with or without these changes