Compatibility in a React Native app
Closed this issue · 2 comments
aymeric75 commented
Hello,
I am trying to use Rembrandt in a React Native app, here is what I did:
npm install rembrandt
then in my App.js file, I added:
import Rembrandt from 'rembrandt'
But I get:
'Rembrandt' is declared but its value is never read.ts(6133)
Could not find a declaration file for module 'rembrandt'. 'c:/Users/aymer/Desktop/CODEUR-CLIENTS_WebDev-TMP/AwesomeProject/node_modules/rembrandt/build/node.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/rembrandt` if it exists or add a new declaration (.d.ts) file containing `declare module 'rembrandt';`ts(7016)
I tried the suggested solution "npm i --save-dev @types/rembrandt", it did not work.
And I don't know how to "add a new declaration (.d.ts) file containing `declare module rembrandt"
Any idea ?
Thank you
Lionad-Morotar commented
rembrandt 项目没有提供类型。如果想屏蔽来自 TypeScript 的报错可以试试这个方法:在项目中添加一个 global.d.ts 文件,然后添加以下代码:
declare module "rembrandt" {
export default any
}
aymeric75 commented
Thanks I will try