react-forms/src/FormTranslationContext.js

19 lines
428 B
JavaScript
Raw Normal View History

2019-03-01 14:43:37 +01:00
import React, { Component } from 'react'
const FormTranslationContext = React.createContext({
renderText: (text) => (text)
});
export default FormTranslationContext
export class FormTranslationConsumer extends Component
{
render()
{
return (
<FormTranslationContext.Consumer>
{(props) => this.props.children(props)}
</FormTranslationContext.Consumer>
)
}
}