0

I have a builder method which wraps a class with injected props and I would like to set class name the same as the wrapped class. how do I achieve this? (just ignore the flow typing if you want)

const buildComponentWithInjectedProps =
  (SubjectClass, injectedProps) => {
    return class extends React.PureComponent {
      /*set classname=name of SubjectClass*/
      render() {
        return (<SubjectClass {...injectedProps} {...this.props} />);
      }
    };
  };
jeff
  • 1,169
  • 1
  • 19
  • 44

1 Answers1

-1

Do you need class name for debugging ReactJS?

https://facebook.github.io/react/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging may help.