Comment

Emiliano

"Is there not a way to put that Button.propTypes thing in the first React.Component style into the class??"

Yes, you can put the propTypes inside the class if you're using ES6 with Babel (but you need to enable stage-0 features)

Just add the following inside the class

static propTypes = {
  day: PropTypes.string.isRequired,
  increment: PropTypes.func.isRequired,
};

Replies

Peter Bengtsson

Thanks! I updated the blog.