Quartz 4

Home

❯

Web

❯

REACT

❯

proptypes

proptypes

Apr 06, 20261 min read

import React from 'react';
import PropTypes from 'prop-types';
 
const RenderName = (props) => {
  return <div>{props.name}</div>;
};
 
RenderName.propTypes = {
  name: PropTypes.string,
};
 
RenderName.defaultProps = {
  name: 'Zach',
};
 
export default RenderName;

https://legacy.reactjs.org/docs/typechecking-with-proptypes.html


Graph View

Created with Quartz v4.5.2 © 2026

  • GitHub
  • Discord Community