pass ref to a class component with React.cloneElement and render prop
问题 I'm writing a component that handle some internal state according to a ref of it's child (a mouse event related to that child's ref for example). This component is using a render-prop to pass on the relevant piece of state to it's child, and render the child with the ref attached via React.cloneElement util. The problem is that when the child is a class component, for some reason the ref is not available, and i can't find a way to render it as it's a react element object with a type of