import React, { Component, PropTypes } from 'react';
import { View } from 'react-native';

// app
import ControlComponent from './Control/Control.component';
import FieldComponent from './Field/Field.component';

/* eslint class-methods-use-this:0 */
export default class FormComponent extends Component {
  static propTypes = {
    schema: PropTypes.any.isRequired,
  }

  constructor() {
    super();

    this.FORM_MAP = {
      control: this.renderControl,
      field: this.renderField,
    };
  }

  renderForm() {
    return this.props.schema.attributes.formComponents.map(
      formComponent => this.FORM_MAP[formComponent.category](formComponent));
  }

  renderControl(control) {
    const props = {
      type: control.type,
      attributes: control.attributes,
    };
    return (
      <ControlComponent key={control.uid} {...props} />
    );
  }

  renderField(field) {
    const props = {
      type: field.type,
      attributes: field.attributes,
    };
    return (
      <FieldComponent key={field.uid} {...props} />
    );
  }

  render() {
    return (
      <View>
        {
          this.renderForm()
        }
      </View>
    );
  }
}

@@ -82,16 +82,59 @@
 native';
+%0Aimport %7B IntlProvider %7D from 'react-intl';
 %0A%0A// app
@@ -403,16 +403,96 @@
 quired,%0A
+    messages: PropTypes.object,%0A  %7D%0A%0A  static defaultProps = %7B%0A    messages: %7B%7D%0A
   %7D%0A%0A  c
@@ -1188,24 +1188,78 @@
    return (%0A
+      %3CIntlProvider messages=%7Bthis.props.messages%7D%3E%0A  
       %3CView%3E
@@ -1267,18 +1267,22 @@
         
-%7B%0A
+  %7B%0A  
         
@@ -1309,18 +1309,22 @@
         
-%7D%0A
+  %7D%0A  
       %3C/
@@ -1325,24 +1325,46 @@
     %3C/View%3E%0A
+      %3C/IntlProvider%3E%0A
     );%0A  %7D%0A%7D

Add IntlProvider to FormComponent