helior / react-highlighter

:high_brightness: Highlight text using React
MIT License
157 stars 42 forks source link

Support React.forwardRef in matchElement #59

Open kachkaev opened 6 years ago

kachkaev commented 6 years ago

After upgrading to styled-components v4 I noticed dev mode warnings just as before https://github.com/helior/react-highlighter/pull/56. The cause of this was that a styled-component is now create using React.forwardRef and this is no longer matched by PropTypes.oneOfType([PropTypes.string, PropTypes.func]).

There's currently no way to properly check against forwardRef prop-type, see https://github.com/facebook/prop-types/issues/200 for details.

This PR implements a temporary workaround similar to https://github.com/algolia/react-instantsearch/pull/1461. With this change, a warning disappears in my locally opened project.

kachkaev commented 6 years ago

@helior 👋

kachkaev commented 5 years ago

ping 🙂

kachkaev commented 4 years ago

👋 @helior

kachkaev commented 1 year ago

👋 @helior 😅