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

[Combobox] TS2605: JSX element type 'string | Element[]' is not a constructor function for JSX elements. #425

Closed
felixmosh opened this issue Jan 12, 2020 · 0 comments · Fixed by #426

Comments

@felixmosh
Copy link
Contributor

🐛 Bug report

After updating to 0.7.2, I get

TS2605: JSX element type 'string | Element[]' is not a constructor function for JSX elements.   
Type 'string' is not assignable to type 'Element'.

Current Behavior

With the usage is a basic usage of ComboboxOptionText.

<ComboboxOption value={item.name}>
   <ComboboxOptionText />
</ComboboxOption>

The type that is generated to ComboboxOptionText is

export declare function ComboboxOptionText(): string | JSX.Element[];
export declare namespace ComboboxOptionText {
    var displayName: string;
}

Expected behavior

It should allow using this component as JSX constructor

Reproducible example

https://codesandbox.io/s/frosty-https-fu22e

Suggested solution(s)

DefinitelyTyped/DefinitelyTyped#20544 (comment)

Additional context

Related to DefinitelyTyped/DefinitelyTyped#20544

Your environment

Software Name(s) Version
Reach Package Combobox 0.7.2
React 16.10.0
Browser
Assistive tech
Node
npm/yarn
Operating System
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.

1 participant