| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1× 1× 1× 1× 1× | import React, {Component} from 'react';
import PropTypes from 'prop-types';
/**
* ExampleComponent is an example component.
* It takes a single property, `label`, and
* displays it.
*/
export default class ExampleComponent extends Component {
render() {
const {label} = this.props;
return (
<div>ExampleComponent: {label}</div>
);
}
}
ExampleComponent.propTypes = {
/**
* A label that will be printed when this component is rendered.
*/
label: PropTypes.string.isRequired
};
|