hackingbeauty / react-mic

Record audio from a user's microphone and display a cool visualization.
https://hackingbeauty.github.io/react-mic/
453 stars 158 forks source link

How to use with typescript project (like NextJs) ? #128

Open diego3 opened 3 years ago

diego3 commented 3 years ago

Hello guys, thanks for this amazing lib.

I'm trying to use react-mic with a NextJs + Typescript project

But seams like react-mic is not ready to work with Typescript, is that right?

import { ReactMic } from 'react-mic'

------ 
import doens't work and in my vscode react-mic part is red with a message saying "Could not find a declaration file for module 'react-mic'. "

I've added react-mic as a dependency with a command:

yarn add react-mic

Everything compiled successfully, but the error is happening at runtime

hackingbeauty commented 3 years ago

Right, TypeScript is a Javascript npm package. I'm not going to be supporting TypeScript, but you can fork the library and create a version of it that works with TypeScript :)