/* render part of building component */
render() {
return (
<div>
<label htmlForm={this.props.name}>
{label}
</label>
{/* general props */}
import React from 'react';
import { reduxForm } from 'redux-form';
const ExampleForm = ({ invalid, submitting, reset }) => {
const handleSubmit = (values) => {
console.log(values); // ...code to submit values
};
return (
<form onSubmit={handleSubmit}>
// React component
import React, { Component } from 'react';
import { Form } from 'formsy-react';
class ExampleForm extends Component {
constructor() {
this.state = { canSubmit: false, };
this.enableSubmit = this.enableSubmit.bind(this);
this.disableSubmit = this.disableSubmit.bind(this);
this.submitValues = this.submitValues.bind(this);
// in your root reducer
import { combineReducers } from 'redux';
import { reducer } from 'redux-form';
export default combineReducers({
form: reducer, // form Reducer which has all details about form.
// ...other reducers });
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
// in your root reducer import { combineReducers } from 'redux'; | |
import { reducer } from 'redux-form'; | |
export default combineReducers({ | |
form: reducer, // form Reducer which has all details about form. | |
// ...other reducers }); | |
``` |
NewerOlder