📜  react prop ytpes - Javascript 代码示例

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

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

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

Hello, {this.props.name}

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