UNPKG

@carbon/react

Version:

React components for the Carbon Design System

15 lines (14 loc) 622 B
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ /** * @param {string} name The name of the prop that must exist to validate * the current prop. * @param {React.Validator} propType The original prop type checker. * @returns {React.Validator} The new prop type checker for the current prop that * becomes required if the prop corresponding to the provided prop name exists. */ export default function requiredIfGivenPropIsTruthy(name: string, propType: React.Validator): React.Validator;