Do not use default export

This commit is contained in:
lukostry 2019-02-15 13:00:37 +01:00
parent f5f34f814e
commit 040acad434
3 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,7 @@
import { Component } from 'ink';
export interface TextInputProps {
interface TextInputProps {
focus?: boolean;
onChange?: (value: string) => void;
onSubmit?: (value: string) => void;
@ -14,4 +14,6 @@ export interface TextInputProps {
value?: string;
}
export default class TextInput extends Component<TextInputProps> { }
declare class TextInput extends Component<TextInputProps> { }
export = TextInput;

View File

@ -1,6 +1,9 @@
/** @jsx h */
import { h, Component } from 'ink';
import TextInput from 'ink-text-input';
// NOTE: `import TextInput = require('ink-text-input');` will work as well
// For importing using ES6 default import as above,
// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true`
interface QueryState {
query: string;

View File

@ -1,5 +1,6 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "react",
"module": "commonjs",
"lib": [