I am beginner in React and Typescript. I have a problem with using react component e.g. https://www.npmjs.com/package/react-toggle-button in typescript.
I generated types by Visual Studio.
Btw import ToggleButton from 'react-toggle-button'; error :/ClientApp/types/react-toggle-button"' has no default export.
So, I imported this way:
import * as ToggleButton from 'react-toggle-button';
<ToggleButton
value={this.state.influencer.billingVATPayer || false}
onChange={(e: any) => { console.log(e) }}
/>
My error: (TS) JSX element type 'index' is not a constructor function for JSX elements. Property 'context' is missing in type 'index'.
Can no-typescript modules be imported in some way?
My Typescript version: 3.2.4 My React version: 16.7.0
Thank you advance