Filip Hoško
Feb 25, 2017 · 1 min read

Hi, I tried to reproduce this but even if I pass an anonymous function like this to a prop the child component won’t re-render as you say. It’s probable that I do something wrong since I’m fairly new to this, but I would like to understand it since it grabbed my attention (as a potential best practice). So I have my components like this <Parent name={this.state.name}>
<Child onSetName={() => this.setState({name: “Droopy”}) }/>
</Parent> , they are both in an App component. When the internal state of <Parent> changes, it will re-render but it won’t re-render the <Child> component regardless if it receives an anonymous function as a prop.