esbenp / react-native-clean-form

Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components
http://esbenp.github.io/2017/01/06/react-native-redux-form-immutable-styled-components/
MIT License
478 stars 83 forks source link

Can not render element? #82

Open yuanzhaocyc opened 6 years ago

yuanzhaocyc commented 6 years ago

<Text>test</Text> can render,but Form can not. my code:

import React, { Component } from 'react'
import { reduxForm } from 'redux-form'
import {
  ActionsContainer,
  Button,
  FieldsContainer,
  Fieldset,
  Form,
  FormGroup,
  Label,
} from 'react-native-clean-form'
import {
  Input,
  Switch
} from 'react-native-clean-form/redux-form'
import { View,Text,Image } from 'react-native'
class ContactForm extends Component {
  constructor(props){
    super(props);
  }
  render(){
    const {handleSubmit, authenticate, submitting} = this.props;
    return (
        <View>
            <Text>test</Text>
            <Form>
                <FieldsContainer>
                    <Fieldset label="Contact details">
                        <Input inlineLabel={false} name="first_name" label="First name" placeholder="John" />
                        <Input inlineLabel={false} name="email" label="Email" placeholder="something@domain.com" />
                    </Fieldset>
                    <Fieldset label="Shipping details" last>
                        <Input inlineLabel={false} name="password" label="Address" placeholder="Hejrevej 33" />
                        <Input inlineLabel={false} name="password_repeat" label="City" placeholder="Copenhagen" />
                        <Switch inlineLabel={false} label="Save my details" border={false} name="save_details" />
                    </Fieldset>
                </FieldsContainer>
                <ActionsContainer>
                    <Button icon="md-checkmark" iconPlacement="right" onPress={()=>{this.props.onSubmit}} submitting={submitting}>Save</Button>
                </ActionsContainer>
            </Form>
        </View>
    )
  }
}

ContactForm = reduxForm({
  form: 'Form'
})(ContactForm)
yuanzhaocyc commented 6 years ago

it's ok to give the form a width and height,but why not styled?