mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* create-react-class: add definitions * react-dom-factories: add definitions * create-react-class: add tests, fix errors * react-dom-factories: add tests, fix lint * react: remove previously deprecated APIs * Remove deprecated usages in other definitions * redux-form: disable strictFunctionTypes Changes to react typings revealed errors in redux-form that are present in 'master'. This needs to be handled separately. * Update create-react-class, react-dom-factories author * Avoid importing create-react-class where possible * Move top-level createReactClass tests to create-react-class
15 lines
479 B
TypeScript
15 lines
479 B
TypeScript
import * as PropTypes from 'prop-types';
|
|
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;
|