Just a note, this pattern will bite you in Server Side Rendering, as the `useEffect` is not run there, the rendered markup wont contain data from the children. Calling `setState` of parent without `useEffect` will probably work, but React prints red warning that you should not do it for a good reasons. Long story short, there is currently no way to pass data from children to the parent, that will work during Server Side Rendering.