📜  react proptypes - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:14.592000             🧑  作者: Mango

代码示例6
import PropTypes from 'prop-types';

class Greeting extends React.Component {
  render() {
    return (
      

Hello, {this.props.name}

); } } Greeting.propTypes = { name: PropTypes.string };