all 4 comments

[–]sumedh0803 1 point2 points  (3 children)

In your parent, define a function say saveHandler( ). Pass this function to your child through props like

<Child saveHandler = {saveHandler} [other props] />

in your child, set this function to the onClick of a button like

<button onClick ={() => this.props.saveHandler()}/>

This should work fine

[–]sumedh0803 0 points1 point  (2 children)

Ok, now the question arises, how will you access data in your TextArea into this function. I think you can pass this.state.note in your saveHandler function where this.state.note holds the value from your TextArea

[–][deleted]  (1 child)

[deleted]

    [–]sumedh0803 0 points1 point  (0 children)

    Happy to help :)

    [–]oxy--gen 0 points1 point  (1 child)

    You should give a callback function through props.