chore(prop-types-decorator): deprecate
This commit is contained in:
parent
504895a730
commit
d7f8d12d88
@ -1,6 +1,18 @@
|
|||||||
import assign from 'lodash/assign'
|
import assign from 'lodash/assign'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
|
// Deprecated because :
|
||||||
|
// - unnecessary
|
||||||
|
// - not standard in the React ecosystem
|
||||||
|
if (__DEV__) {
|
||||||
|
console.warn(`DEPRECATED: use prop-types directly:
|
||||||
|
class MyComponent extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
foo: PropTypes.string.isRequired
|
||||||
|
}
|
||||||
|
}`)
|
||||||
|
}
|
||||||
|
|
||||||
// Decorators to help declaring properties and context types on React
|
// Decorators to help declaring properties and context types on React
|
||||||
// components without using the tedious static properties syntax.
|
// components without using the tedious static properties syntax.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user