MikeyParton / react-speech-kit

React hooks for Speech Recognition and Speech Synthesis
https://mikeyparton.github.io/react-speech-kit
237 stars 63 forks source link

Peer dependency should be upgraded to recent version of React - 17.0.2 #64

Open PoojaK97 opened 2 years ago

PoojaK97 commented 2 years ago

It gives Error on latest React apps.

ERESOLVE unable to resolve dependency tree.

alevhe commented 2 years ago

@PoojaK97 have you found a solution?

bburns commented 2 years ago

It seems to works okay with React 18.1 - npm install --force react-speech-kit

jsandlerus commented 2 years ago

I have updated to React 18.1 and it still not working after doing --force install.

jsandlerus commented 2 years ago

It seems to works okay with React 18.1 - npm install --force react-speech-kit

Can you please share the setup you have working? I followed the exact same code from this example page and I cannot make it work. -> https://github.com/MikeyParton/react-speech-kit/blob/master/examples/src/useSpeechSynthesis.jsx

bburns commented 2 years ago

Sure - it worked with a bare minimum NextJs setup -

npx create-next-app tourguide
cd tourguide
npm install
npm install --force react-speech-kit

then

import { useSpeechSynthesis } from 'react-speech-kit'
export default function Home() {
  const { speak } = useSpeechSynthesis()
  ...
  speak({ text })

package.json -

{
  "name": "tourguide",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "12.1.6",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-speech-kit": "^3.0.1"
  },
  "devDependencies": {
    "eslint": "8.16.0",
    "eslint-config-next": "12.1.6"
  }
}