mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
473 B
TypeScript
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;
|