Unable to set up with React #126
Replies: 3 comments 6 replies
-
Use |
Beta Was this translation helpful? Give feedback.
-
The Faker we have published today does not have Typescript support "out-of-the-box". There is a maintained We will be publishing (in the next few months) first-party types once we've merged various PRs, but for currently published versions of npm install -d @faker-js/faker @types/faker And then add // faker.d.ts
declare module "@faker-js/faker" {
import faker from "faker";
export default faker;
} And then import like import faker from "@faker-js/faker"; |
Beta Was this translation helpful? Give feedback.
-
@alex3wielki is this still an issue for you? |
Beta Was this translation helpful? Give feedback.
-
I installed using
npm i @faker-js/faker -D
I added the
faker.d.ts
file with this content:But ts doesn't see
faker
as a valid module. What am I missing?Here is a reproduced sandbox
https://codesandbox.io/s/amazing-smoke-qx63t?file=/src/App.tsx
Beta Was this translation helpful? Give feedback.
All reactions