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} />);
      }
    };
  };
0

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

1 Comment

no, a real class name

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.