this.state = {
text: 'Hello world'
}
handleChangeText = text => {
this.setState({ text })
}
render() {
return <InnerComponent handleChangeText={this.handleChangeText} text={this.state.text} />
}
const InnerComponent = ({ handleChangeText }) => {
return (
<div onClick={() => handleChangeText('some text')}>text</div>
);
}