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

InitialValues with redux-form #96

Open ticketapp opened 4 years ago

ticketapp commented 4 years ago

I'm trying to add an initial value as I'm doing it with a standard redux-form, but nothing happens. It is not documented, how can I achieve this? Here is the snippet of code:

function mapStateToProps(state) {
  const firstName = state.auth.firstName;
  const initialValues = {
    firstName
  };
  return {
    initialValues
  };
}

export default connect(mapStateToProps)(
  reduxForm({ form: "Form" })(Form)
);