DefinitelyTyped/types/react-is-deprecated/react-is-deprecated-tests.ts
2017-03-24 14:27:52 -07:00

15 lines
473 B
TypeScript

import { PropTypes } from 'react';
import { deprecate, addIsDeprecated } from 'react-is-deprecated';
// test: one-off deprecation
deprecate(PropTypes.string, 'message');
// test: one-off deprecated with isRequired
deprecate(PropTypes.string.isRequired, 'message');
// test: isDeprecated is added to a proptype
addIsDeprecated(PropTypes).string.isDeprecated('message');
// test: isRequired is still present on that proptype
addIsDeprecated(PropTypes).string.isRequired;