Skip to content

Could not find a declaration file for module 'react-tabs' on v4.2.1 #516

@javed24

Description

@javed24

I'm on version 4.2.1 and currently working on rewriting our implementation of react-tabs to TypeScript (not planning to bump the major version to 5 for now, just working on migrating it from JS to TS). I'm simply importing the following in my .tsx component

import {Tabs, TabList, Tab, TabPanel} from 'react-tabs';

However, it throws the following error:

Could not find a declaration file for module 'react-tabs'. '/User/<path-to-directory>/node_modules/react-tabs/lib/index.js' implicitly has an 'any' type.

I tried what the error message suggested as a possible solution, which was Try npm i --save-dev @types/react-tabs. After installing it, I tried running npm ci, which didn't remove the error. I've also tried deleting the node_modules folder altogether and running npm install to clear the cache but to no avail. I didn't see anything regarding version 4.2.1 being incompatible with .tsx components or anything of that sort, but I'm not sure what would be the way to address this issue. Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions