score:4

Accepted answer

I think the issue here is more to do with the library element Media from react-bulma-components that you are wrapping. This component exposes a prop named domRef that can be used to pass the DOM reference to the HTML element underneath the wrappers.

const CommentItem = React.forwardRef(
  ({ comment }, ref) => {
    return (
      <CommentMediaWrapper domRef={ref}>
        <div>...</div>
      </CommentMediaWrapper>
    );
  }
);

Github Reference


Related Query

More Query from same tag