Skip to content

fix: upgrade RTL version to avoid peer-deps mismatch - #13738

Merged
rickhanlonii merged 10 commits into
react:mainfrom
MatanBobi:chores/update-rtl-version-rtl-16
Jan 28, 2025
Merged

fix: upgrade RTL version to avoid peer-deps mismatch#13738
rickhanlonii merged 10 commits into
react:mainfrom
MatanBobi:chores/update-rtl-version-rtl-16

Conversation

@MatanBobi

Copy link
Copy Markdown
Contributor

Resolves#13721

This PR upgrades the installed version of RTL to resolve the peer deps issue.
It also installs DTL because RTL version 16 requires DTL to be installed.

@MatanBobi

MatanBobi commented Dec 27, 2024

Copy link
Copy Markdown
ContributorAuthor

I'm trying to understand the reason for the tests breaking here but I'm not sure it's related to my changes.
Test failures reproduce on main too and are unrelated to my change.

@MatanBobiMatanBobi changed the title chore: upgrade RTL version to avoid peer-deps mismatchfix: upgrade RTL version to avoid peer-deps mismatchDec 29, 2024
@JoeBrar

Copy link
Copy Markdown

Hi, when will this PR get accepted and merged into main branch?

rickhanloniiand others added 2 commits January 27, 2025 21:32
Co-authored-by: Rajhans Jadhao <rajhans.jadhao@gmail.com>
@rickhanlonii

Copy link
Copy Markdown
Contributor

The remaining test failure seems legit but I'm not sure how to fix.

@JoeBrar

Copy link
Copy Markdown

Looks like the failing tests needs to be updated according to the latest React version

@iamrajhans

Copy link
Copy Markdown
Contributor

hi @rickhanlonii, I think will need to use the react-testing-lib for the failing test cases just like here

import { render, screen } from '@testing-library/react';
describe('dynamic import', () => {
it('renders without crashing', async () => {
// Dynamically import the component
const DynamicImport = (await import('./DynamicImport')).default;
// Render the component
render(<DynamicImport />);
expect(screen.getByText('Hello World!')).toBeInTheDocument();
});
});

Reference link - https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen

@rickhanlonii

Copy link
Copy Markdown
Contributor

@iamrajhans no, these tests are not using RTL. The issue is that the webpack config for SVGs uses an old version of @svgr/webpack which inlines an old JSX transform, which is not supported in 19. Not sure how to fix that, so going to ignore the SVG tests, and the SVG support can be fixed in a follow up if needed.

@rickhanlonii
rickhanlonii merged commit fde66a2 into react:mainJan 28, 2025
@Greg-Myers-SBGreg-Myers-SB mentioned this pull request Feb 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error from using npx create-react-app

6 participants

@MatanBobi@JoeBrar@rickhanlonii@iamrajhans@facebook-github-bot@wasimsalihi