Last active
August 27, 2018 21:54
-
-
Save jamesreggio/f595b626b984e86658d0d2ea10a8ac99 to your computer and use it in GitHub Desktop.
Log output showing the broken interaction between React.forwardRef and hoist-non-react-statics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Even though CurrentEpisodeWaveform is a component class that | |
// properly composes the three HOCs with Waveform, its static | |
// properties make it appear like a `forwardRef` component type. | |
const CurrentEpisodeWaveform = compose( | |
withCurrentEpisode, | |
withEpisodeAmplitudes, | |
withSize | |
)(Waveform); | |
console.log(typeof CurrentEpisodeWaveform); | |
// => 'function' | |
console.log(Object.keys(CurrentEpisodeWaveform)); | |
// => [ | |
// 'MIN_AMPLITUDE', | |
// 'MAX_AMPLITUDE', | |
// '$$typeof', <= These are bad! | |
// 'render', <= They're hoisted all the way from withSize. | |
// ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment