bvaughn / react-highlight-words

React component to highlight words within a larger body of text
https://bvaughn.github.io/react-highlight-words/
MIT License
2.16k stars 170 forks source link

react.PropTypes will be removed in V16 #30

Closed Fasani closed 7 years ago

Fasani commented 7 years ago

I noticed the following warning with a newer version of React which I installed today.

~/react-highlight-words/dist/main.js

Line: 90

Highlighter.propTypes = {
      activeClassName: _react.PropTypes.string,
      activeIndex: _react.PropTypes.string,
      autoEscape: _react.PropTypes.bool,
      highlightClassName: _react.PropTypes.string,
      highlightTag: _react.PropTypes.string,
      highlightStyle: _react.PropTypes.object,
      searchWords: _react.PropTypes.arrayOf(_react.PropTypes.string).isRequired,
      textToHighlight: _react.PropTypes.string.isRequired,
      sanitize: _react.PropTypes.func
    };

Creates the following warning: Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs

Fasani commented 7 years ago

If you wish, I don't mind updating the project and sending a PR.

Fasani commented 7 years ago

Actually, I can see the project is already updated but via NPM it seemed to load 0.6.0. I have updated to 0.8.0 and this issue is now closed.

bvaughn commented 7 years ago

Thanks for the follow up :)

On Aug 2, 2017 7:54 AM, "Michael Fasani" notifications@github.com wrote:

Actually, I can see the project is already updated but via NPM it seemed to load 0.6.0. I have updated to 0.8.0 and this issue is now closed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bvaughn/react-highlight-words/issues/30#issuecomment-319697424, or mute the thread https://github.com/notifications/unsubscribe-auth/AABznUXSOvfEWJ6UEaVzlj8NQX3tj4K4ks5sUI2hgaJpZM4OrLPL .