What is the recommended pattern for doing a setState on a parent from a child component.
var Todos = React.createClass({
getInitialState: function() {
If you are working with a class component as parent, one very simple way of passing a setState to a child is by passing it within an arrow function. This works as it sets a hoisted environment that can be passed around:
class ClassComponent ... {
modifyState = () =>{
this.setState({...})
}
render(){
return <> >
}
}