You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
370 B
17 lines
370 B
7 years ago
|
// highlight-next-line
|
||
|
function logProps(WrappedComponent) {
|
||
|
class LogProps extends React.Component {
|
||
|
componentWillReceiveProps(nextProps) {
|
||
|
console.log('old props:', this.props);
|
||
|
console.log('new props:', nextProps);
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
// highlight-next-line
|
||
|
return <WrappedComponent {...this.props} />;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return LogProps;
|
||
|
}
|