This is small quality of life change that I found helpful when defining our components PropTypes. It adds the p prop type's shape and exports it. This lets you do the following for your components, instead of copying the shape:
import React, { Component, PropTypes } from 'react';
import { setLanguage, getP, PropType as p } from 'redux-polyglot';
class App extends Component {
render() { /* ... */ }
}
App.propTypes = {
children: PropTypes.node,
p
};
This is small quality of life change that I found helpful when defining our components PropTypes. It adds the
p
prop type's shape and exports it. This lets you do the following for your components, instead of copying the shape: