I'm trying to pass built in react function through props and trying to set state but I get this
as undefined!
I've tried something like this:
index.js
let somefun = function(){
this.setState({myvar:1});
}
ReactDom.render(<someComponent body={<someOtherComponent1 componentWillUpdate={somefun}/>} />, document.getElementById('someValidID'));
someOtherComponent1.js
React.createElement( someOtherComponent1, { "className": "someclass"} )
My Problem is whenever I pass a builtin function ie, functions present in react prototype this
is always undefined.
How can I send built-in functions through props?