react-component / react-component/tabs

import {TabPane} from 'rc-tabs' throws an error in typescript

Open
#571 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
572
Forks
241
Avg merge
4d 18h
Merged PRs (30d)
4

Description

When I import the modules like default
import Tabs, { TabPane } from 'rc-tabs';
The compiler throws an error which says the TabPane module is not available.
TS2614: Module '"rc-tabs"' has no exported member 'TabPane'
It works anyway if I ignore the message, but it keeps throwing this error message every time I make changes in dev environment.
The error happens when I'm using typescript and it goes away when I set this tsconfig parameter to true:
"allowSyntheticDefaultImports": true

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the TypeScript error with import Tabs, { TabPane } from 'rc-tabs' while allowSyntheticDefaultImports is disabled, then inspect the package's exports and type declarations. Done means the named import type-checks without requiring that tsconfig workaround and the existing development workflow no longer reports TS2614.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.