function logProps(Component) { class LogProps extends React.Component { // ... } function forwardRef(props, ref) { return ; } // Give this component a more helpful display name in DevTools. // e.g. "ForwardRef(logProps(MyComponent))" // highlight-range{1-2} const name = Component.displayName || Component.name; forwardRef.displayName = `logProps(${name})`; return React.forwardRef(forwardRef); }