yarn @welldone-software/why-did-you-render 2.4.0
Support React.createFactory

latest releases: 8.0.3, 8.0.1, 8.0.0...
5 years ago
  • Updated all packages on development.
  • Added tests and demos of React.cloneElement and React.createFactory.
  • We found out React.createFactory skipped the monkey patch we apply on React.createElement thus the following code didn't work:
import {lifecycle} from 'recompose';

const PostsList = ({ posts }) => (
  <ul>{posts.map(p => <li>{p.title}</li>)}</ul>
);

const PostsListWithData = lifecycle({
  componentDidMount() {
    fetchPosts().then(posts => {
      this.setState({ posts });
    })
  }
})(PostsList);
PostsList.whyDidYouRender = true;

because lifecycle uses React.createFactory to create it's child which is PostsList in this case:
https://github.com/acdlite/recompose/blob/master/src/packages/recompose/lifecycle.js

Don't miss a new why-did-you-render release

NewReleases is sending notifications on new releases.