0
屬性有一種被稱爲發送的onSubmit屬性哪裏是魔法,使用的onSubmit像部件
import SimpleForm from "./SimpleForm";
<SimpleForm onSubmit={showResults} />
和成分組成:
import React from 'react';
import { Field, reduxForm } from 'redux-form';
const SimpleForm = props => {
const { handleSubmit, pristine, reset, submitting } = props;
return (
<form onSubmit={handleSubmit}>
<div>
其中魔術的onSubmit被轉換爲handleSubmit道具?通常一個孩子的組成部分必須閱讀:props.onS提交
是與redux?我見過沒有終極版形式相同...
完整的代碼示例:
https://codesandbox.io/s/x20j62365o