Repository navigation
Passing MDText in the React 16.3+ Context
MDText object can be passed around using new official react context API.
import { MDText } from 'i18n-react';
let MDTextContext = React.createContext();
let Texts = new MDText({...});
<MDTextContext.Provider value={Texts}>
<MDTextContext.Consumer>{ (T) =>
<T.span text="path.to.string" />
}</MDTextContext.Consumer>
</MDTextContext.Provider>See updated examples/yaml for complete example.