Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type

前端 未结 14 1208
鱼传尺愫
鱼传尺愫 2020-12-05 09:09

I am trying to import components from react-materialize as -

import {Navbar, NavItem} from \'react-materialize\';

But when the webpack is

14条回答
  •  孤街浪徒
    2020-12-05 09:49

    If there is no @types/ for the module you are using, you may easily circumvent the issue by adding a // @ts-ignore comment above i.e.

    // @ts-ignore
    import { Navbar, NavItem } from 'react-materialize';
    

    Alternatively you may create the missing @types/ following:

    declaration files publishing

    DefinitelyTyped how can i contribute

提交回复
热议问题