R
R
Rapen2017-04-13 21:14:38
JavaScript
Rapen, 2017-04-13 21:14:38

How does a higher order component understand data from an embeddable?

I have the following code, a higher order component that returns another component, in the inline method,
componentwillreceiveprops has data returned by console.log, how was it received from the Component?

import React fromt 'react';

function logProps(Component){
        return class extends React.Component{
                  componentWillRecieveProps(nextProps){
                           console.log('prevProps', this.props); // ???
                           console.log('prevProps', nextprops);//???
                render(){
                return <Component {...this.props} />
               }
             }
         } 
}
export        default logProps;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Feninets, 2017-04-19
@Rapen

React under the hood works out "proxy props"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question