Skip to content

Conversation

@brandongregoryscott
Copy link
Contributor

@brandongregoryscott brandongregoryscott commented Apr 22, 2022

Overview

Resolves #1453

  • Updates our dev dependencies for react/react-related packages to v18.
  • Widens our peer dependency requirements to include React v18

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

  • Updated Typescript types and/or component PropTypes
  • Added / modified component docs
  • Added / modified Storybook stories

@brandongregoryscott brandongregoryscott added the dependencies Pull requests that update a dependency file label Apr 22, 2022
@netlify
Copy link

netlify bot commented Apr 22, 2022

Deploy Preview for evergreen-storybook ready!

Name Link
🔨 Latest commit 487f862
🔍 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 brandongregoryscott marked this pull request as draft April 29, 2022 16:47
@brandongregoryscott
Copy link
Contributor Author

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

test('<Text /> has undefined behavior when trying to set arbitrary sizes', () => {
render(<Text size={800} />)
expect(mockFn.mock.calls.length).toEqual(1)
expect(mockFn.mock.calls.length).toBeGreaterThanOrEqual(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The warning from ReactDOM.render added an additional call here 🤦

@brandongregoryscott brandongregoryscott merged commit 9f2fab9 into segmentio:master Jun 21, 2022
@brandongregoryscott brandongregoryscott deleted the react-18-support branch June 21, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

React 18 support

2 participants