davidchin/react-input-range

JSX element type 'InputRange' does not have any construct or call signatures.

Opened this issue · 2 comments

When importing InputRange into a .tsx file as a default import:

import InputRange from 'react-input-range';

I get this error:
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of COMPONENT.

When importing InputRange int a .tsx file as a default import with the alias method:

import * as InputRange from 'react-input-range';

I get this error:
JSX element type 'InputRange' does not have any construct or call signatures.

Had other people look at it. Doesn't seem to be anything wrong with the import. Using the latest version of Typescript 2.6.2 and React 15.5.4.
Anybody else having this issue?

Yeah, I think there's an issue with the definition file.

For the moment, this workaround works for me without losing the type check:

import * as ReactInputRange from 'react-input-range'

const InputRange: typeof ReactInputRange.default = ReactInputRange as any

<InputRange ... />