Skip to content

🐛 Typings Issue with Headless Select Example in TypeScript #54

@alexasselin008

Description

Describe the bug

The example provided in the documentation at https://orbit.sharegate.design/?path=/docs/select--default-story#headless-select cannot be implemented in TypeScript outside the source codebase. After compilation, the typings for triggerProps and overlayProps are incorrectly inferred as "never."

Steps to reproduce

1- In a sandbox, copy this example: https://orbit.sharegate.design/?path=/docs/select--default-story#headless-select.

Expected results

The TypeScript compilation should successfully generate typings for triggerProps and overlayProps based on the provided example, allowing for proper usage in external projects.

Actual Behavior:

After compilation, the typings for triggerProps and overlayProps are incorrectly inferred as "never," causing a compilation error.
image

Workaround:

A workaround for this issue is to apply ts-ignore when spreading triggerProps and overlayProps in the code. While this resolves the compilation error, it is not an ideal solution as it bypasses TypeScript type checking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions