// ============ Before (15.4 and below)
import React, { Component, PropTypes } from 'react';
class App extends Component {
render() {
return (
<div>{this.props.text}</div>
);
}
}
App.propTypes = {
text: PropTypes.string.isRequired
};
// ============ After (15.5)
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class App extends Component {
render() {
return <div>{this.props.text}</div>;
}
}
App.propTypes = {
text: PropTypes.string.isRequired,
};