Skip to content

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

@STEjovanovicFAN

Description

@STEjovanovicFAN

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",

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