Semantic-Org / Semantic-UI-React

The official Semantic-UI-React integration
https://react.semantic-ui.com
MIT License
13.21k stars 4.05k forks source link

Improve typings [v3] #4432

Closed layershifter closed 10 months ago

layershifter commented 1 year ago

Bug Report

Steps

While v3 supports native ref forwarding, typings should be updated to reflect this.

Expected Result

Typings work as expected.

Actual Result

TS2769: No overload matches this call.   Overload 1 of 2, '(props: ButtonProps | Readonly<ButtonProps>): Button', gave the following error.     Type 'MutableRefObject<HTMLButtonElement | undefined>' is not assignable to type 'LegacyRef<Button> | undefined'.       Type 'MutableRefObject<HTMLButtonElement | undefined>' is not assignable to type 'RefObject<Button>'.
Parameter 'el' implicitly has an 'any' type, but a better type may be inferred from usage.ts(7044)

Version

3.0.0-beta.0

Testcase

https://codesandbox.io/s/semantic-ui-example-forked-9spw8n?file=/example.tsx

layershifter commented 1 year ago

Actions

layershifter commented 9 months ago

Released in 3.0.0-beta.2 🎉