Ask Question

JSX element type "AutoComplete" does not have any construct or call signatures?

I am getting the following error:

JSX element type 'ReactAutoComplete' does not have any construct or call signatures. ts(2604)

import React from "react";
import * as ReactAutoComplete from "react-autocomplete";

export class AutoComplete extends React.Component<Props> {

  render() {
    <>
      <ReactAutoComplete {...reactAutoCompleteProps} />
    </>
  }
}

What am I doing wrong?

ReactTypeScript

3034 views

Authorยดs AnkiCodes image

AnkiCodes

Last edited on

1 Answer available

Best answer

it seems that the import causes the issue. Change the import to following solves the issue

import { default as ReactAutoComplete } from "react-autocomplete";