Answers for "prop-types is object"

-1

prop-types

npm install --save prop-types
Posted by: Guest on December-23-2020
3

propTypes

import PropTypes from 'prop-types';

class Greeting extends React.Component {
  render() {
    return (
      <h1>Hello, {this.props.name}</h1>
    );
  }
}

Greeting.propTypes = {
  name: PropTypes.string
};
Posted by: Guest on August-27-2020

Browse Popular Code Answers by Language