“Aprofetos” Respostas de código

Array de objetos de lucro

MyComponent.propTypes = {
  items: PropTypes.arrayOf(
    PropTypes.shape({
      code: PropTypes.string,
      id: PropTypes.number,
    })
  ),
};
Outrageous Opossum

Aprofetos

import PropTypes from "prop-types";

MyComponent.propTypes = {
  name: PropTypes.string,
  id: PropTypes.number.isRequired,
  img: PropTypes.string
  grades: PropTypes.arrayOf(PropTypes.number),
  friends: PropTypes.arrayOf(
    PropTypes.shape({
      id: PropTypes.number,
    })
  ),
  list: PropTypes.arrayOf(PropTypes.any),
};

MyComponent.defaultProps = {
  img: "https://picsum.phones/200/300",
}
Inexpensive Impala

Aprofetos

import PropTypes from 'prop-types';

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

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

reaja prothpes ou

size: PropTypes.oneOfType([
  PropTypes.string,
  PropTypes.number
]),
Strange Sandpiper

Respostas semelhantes a “Aprofetos”

Procure respostas de código populares por idioma

Procurar outros idiomas de código