Skip to content

Anyone getting this error? 'CheckboxTree' cannot be used as a JSX component #502

Open
@ariscruz

Description

@ariscruz

Full error:
'CheckboxTree' cannot be used as a JSX component.
Its instance type 'CheckboxTree' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type 'import
Type '{}' is not assignable to type 'ReactNode'

Some details:
react-checkbox-tree: "1.8.0"
react: "^17.0.2"
react-dom: "^17.0.2"
react-types: "^17.0.37"

We're using yarn to build.
Tried to downgrade react-checkbox-tree to "1.7.3" but same error.

Have looked into adding a resolutions for @types/react to 17 (similar to this: facebook/react#24304 (comment)), did a cleanup of node_modules and then yarn install but error still persists

Updating to react18 is not an option yet.
Appreciate your help. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions