import React from 'react'; import PropTypes from 'prop-types'; const ExampleComponent = ({ prop }) => { if (typeof prop === 'number') { returnIn this example, we have a simple React component that takes a prop called `prop`. By using `PropTypes.oneOfType`, we are specifying that the `prop` must be either a number, a string, or an object. The `isRequired` flag indicates that the prop is required and must be passed to the component. This code example uses the PropTypes package from the React library.The prop is a number: {prop}; } if (typeof prop === 'string') { returnThe prop is a string: {prop}; } returnThe prop is an object: {JSON.stringify(prop)}; }; ExampleComponent.propTypes = { prop: PropTypes.oneOfType([ PropTypes.number, PropTypes.string, PropTypes.object, ]).isRequired, };