jdeniau/ink-tab

Fails to compile when using typescript

philipp-cloudproduce opened this issue · 1 comments

When I put your foo,bar,baz tabs example into my tsx I received the following error:

src/index.tsx:128:17 - error TS2605: JSX element type 'ReactNode' is not a constructor function for JSX elements.
Type 'string' is not assignable to type 'Element'.

128 Foo

Here is the offending snippet of my code in side a vanilla class component:

render() {
    return (
      <Box>
        <Tabs onChange={this.handleTabChange}>
          <Tab name="foo">Foo</Tab>
          <Tab name="bar">Bar</Tab>
          <Tab name="baz">Baz</Tab>
        </Tabs>
        {this.state.activeTab === 'foo' && 'Selected tab is "foo"'}
        {this.state.activeTab === 'bar' && 'Selected tab is "bar"'}
        {this.state.activeTab === 'baz' && 'Selected tab is "baz"'}
      </Box>
    );
}

Thanks 👍

This should be fixed in 3.0.2

As I am not really used to typescript, feel free to reopen the issue if the bug i still occuring.