JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
674 stars 120 forks source link

import React, { PropTypes, Component } from 'react' #14

Closed DoloMike closed 5 years ago

DoloMike commented 5 years ago

This is in the readme and will throw an error: import React, { PropTypes, Component } from 'react'

const propTypes = {
    // Props injected by SpeechRecognition
    transcript: PropTypes.string,
    resetTranscript: PropTypes.func,
    browserSupportsSpeechRecognition: PropTypes.bool
};

the error: TypeError: Cannot read property 'string' of undefined

Note: React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead.

The readme should be updated to use: import PropTypes from 'prop-types'

Also prop-types should now be a peer dependency if this is required.

JamesBrill commented 5 years ago

You're absolutely right - thanks for pointing this out. I'll update this when I get a chance next week.

JamesBrill commented 5 years ago

Resolved in https://github.com/FoundersFactory/react-speech-recognition/pull/15