Will a react component that is wired up with mapStateToProps get re-rendered on prop changes also?

Viewed 6

I have a react component that is wired up using mapStateToProps, and the component is also passed props from the parent component.

Will the component re-render if either the redux state changes or the props passed to it change?

    <User
       location={...}
       age={...}
       profileUrl={...}
    />

const User = ({location, age,...}) => {

};

function mapStateToProps(...) {
  return {
     age: state.user.age
  };

export default connect(mapStateToProps()(User);

}

Will the component re-render if either the age changes in redux or the profileUrl changes that is passed from the parent component?

0 Answers
Related