Created
August 27, 2019 12:46
-
-
Save Bo-Duke/c44a38cead9463c427e4b2e1b5af7bf4 to your computer and use it in GitHub Desktop.
Compare props and nextProps in console.table
This file contains hidden or 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
| const props2table = (props, nextProps, list) => | |
| Object.assign({}, ...Object.keys(props) | |
| .filter(e => list.includes(e)) | |
| // .filter(e => props[e] !== nextProps[e]) | |
| .map(k => ({[k]: {props: props[k], nextProps: nextProps[k]}})) | |
| ); | |
| console.table(props2table(this.props, nextProps, ['value'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment