score:1

class MyComponent extends Component {
  static defaultProps = {
    __TYPE: "MyDateRange"
  };
  constructor(props) {
    console.log("props", props);
    super(props);
  }
  render() {
    return <div> test </div>;
  }
}

score:2

import React from "react";
import { render } from "react-dom";

class MyComponent extends React.Component {
  constructor(props) {
    console.log("props", props);
    super(props);
  }

  render() {
    return null;
  }
}

MyComponent.defaultProps = {
  __TYPE: "MyDateRange"
};

render(
  <MyComponent onEnterKey={() => console.log("snuh")} />,
  document.getElementById("app")
);

Related Query

More Query from same tag