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

Type check with @types/react 18 failing #4352

Closed
Tracked by #4354
bryanjtc opened this issue Apr 9, 2022 · 4 comments · Fixed by #4356
Closed
Tracked by #4354

Type check with @types/react 18 failing #4352

bryanjtc opened this issue Apr 9, 2022 · 4 comments · Fixed by #4356

Comments

@bryanjtc
Copy link

bryanjtc commented Apr 9, 2022

Bug Report

Steps

Just install @types/react, @types/react-dom v18 and typescript and update react and react-dom to v18 in any project using semantic-ui-react

Expected Result

No error

Actual Result

Type checking throws this errors:

JSX element type 'Header' does not have any construct or call signatures

The same error happens with Segment, Grid, List and Image

Version

2.1.2

Testcase

[Fork, update, and replace this pen to show the bug]:

Sandbox example

image

I think this error is happening because many elements extend from the type StatelessComponent.
This has breen deprecated.
image

@welcome
Copy link

welcome bot commented Apr 9, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@casperOne
Copy link

Can confirm, currently seeing it with any component that has child elements after upgrading to react types 18.

@jchook
Copy link

jchook commented Apr 10, 2022

It looks like semantic-ui-react does not support React 18.x yet.

The package.json specifies react@"^16.8.0 || ^17.0.0" as a peer dependency.

@layershifter layershifter mentioned this issue Apr 11, 2022
7 tasks
Lurk pushed a commit to Lurk/Semantic-UI-React that referenced this issue Apr 18, 2022
layershifter added a commit that referenced this issue Apr 19, 2022
* fixes #4352

* - remove @types/react from resolutions
- add an assertion to "test/typings"

Co-authored-by: Oleksandr Fediashov <olfedias@microsoft.com>
@layershifter
Copy link
Member

The fix was released in semantic-ui-react@2.1.3.

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

Successfully merging a pull request may close this issue.

4 participants