Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the render method of Label error when trying to upgrade to React v19 #3355

Open
ahmedalatawi opened this issue Dec 16, 2024 · 1 comment

Comments

@ahmedalatawi
Copy link

Describe the bug
I get the follow error when I try to upgrade to React v19. This happens when I try to use the Label component, or any other component that uses it internally:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `Label`.

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `Label`.

I'm using the latest version of @cmsgov/design-system which is 12.0.0

However, when I downgrade @cmsgov/design-system to version 9.0.0, the error goes away.

To Reproduce
Steps to reproduce the behavior:

  1. Install React 19, e.g. npm i react@^19.0.0 react-dom@^19.0.0
  2. Import Label component from @cmsgov/design-system
  3. See error

Expected behavior
The Label component from @cmsgov/design-system version 12.0.0 (latest) should work with React 19.

Screenshots
image

Desktop (please complete the following information):

  • Browser: chrome
@jack-ryan-nava-pbc
Copy link
Collaborator

Thank you for opening this @ahmedalatawi

Can you supply the codebase/repository you are working in? I'd also love to see where you are importing the Label and how it's being used, so if you could share that context as well I'd greatly appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants