Reputation: 11744
I am new in react, and I've been doing a project with Flow
. Last night i met TypeScript
. It's awesome.
I've decided to migrate to TypeScript
from Flow
and have been converting my .js/.jsx
files to .ts/.tsx
. I've installed type definitions for react, redux etc
It works perfectly fine. But , I can't find type definition for a library called react-native-material-color
. It's not a famous library. I am getting below error.
and when i try to install the typedef using npm , am getting 404
How can i fix the error ?
Is there any option to tell TypeScript to skip the type check for a specific library ?
Upvotes: 3
Views: 1308
Reputation: 1689
Quick and dirty:
// @ts-ignore
import Color from "react-native-material-color"
Upvotes: 2
Reputation: 6112
You can fix the error by writing typings yourself, or preferably by installing the types (if they do exist) using npm install --save-dev @types/react-native-material-color
.
You can require the implementation without importing the typings like so:
Example:
const Color = require("react-native-material-color");
Upvotes: 5