Tiqa / redux-polyglot

Polyglot.js bindings for Redux
MIT License
58 stars 13 forks source link

Quality Of Life: Export the p PropType #72

Closed nemosupremo closed 7 years ago

nemosupremo commented 7 years ago

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
};
guillaumearm commented 7 years ago

Hi, thanks for contributing 👍

as you explained in #73, can you add the tt translation morph ?

nemosupremo commented 7 years ago

Done.