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

Error: 'Split' cannot be used as a JSX component - TS2786 #795

Open
STEjovanovicFAN opened this issue Sep 21, 2023 · 0 comments
Open

Error: 'Split' cannot be used as a JSX component - TS2786 #795

STEjovanovicFAN opened this issue Sep 21, 2023 · 0 comments

Comments

@STEjovanovicFAN
Copy link

When attempting to use the 'Split' component as a JSX element in our codebase, TypeScript is throwing an error with the message:

TS2786: 'Split' cannot be used as a JSX component.
  Its instance type 'Split' is not a valid JSX element.
    Type 'Split' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.

This is the boilerplate for my wrapper class

import * as React from "react";
import Split from "react-split";

interface Props {
}

export default class Split extends React.PureComponent<Props, {}> {
  public render() {

    return (
      <Split>
      </Split>
    );
  }
}

Using:
"react": "^16.10.2",
"typescript": "^4.6.3",
"react-split": "^2.0.14",

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

No branches or pull requests

1 participant