react final form listeners
v1.0.3
? React最终表单听众是一个有用组件的集合,用于聆听A中的字段?反应最终形式。
npm install --save react-final-form-listeners react-final-form final-form或者
yarn add react-final-form-listeners react-final-form final-form import { Form , Field } from 'react-final-form'
import { OnChange } from 'react-final-form-listeners'
const MyForm = ( ) => (
< Form
onSubmit = { onSubmit }
render = { ( { handleSubmit , pristine , invalid } ) => (
< form onSubmit = { handleSubmit } >
< div >
< label >
< Field name = "foo" component = "input" type = "checkbox" /> Turn foo on?
</ label >
< OnChange name = "foo" >
{ ( value , previous ) => {
// do something
} }
</ OnChange >
</ div >
...
</ form >
) }
/>
) ExternallyChangedname : Stringchildren: (externallyChanged: boolean) => React.NodeOnBlurname : Stringchildren: () => voidOnChangename : Stringchildren: (value: any, previous: any) => voidOnFocusname : Stringchildren: () => void 以下可以从react-final-form-listeners中进口。
ExternallyChanged当指定的字段最后在外部更新时(在不活动时更改)时,渲染器是带有boolean标志的渲染道具。
name : String聆听的字段名称。
children: (externallyChanged: boolean) => React.Node给定布尔国旗的渲染道具。
OnChange每当指定的字段更改时,请致电其children回调。它什么都没有。
name : String聆听的字段名称。
children: (value: any, previous: any) => void每当更改指定字段时,都会调用一个函数。它通过了新值和上一个值。
OnFocus每当指定的字段变得活跃时,请致电其children回调。它什么都没有。
name : String聆听的字段名称。
children: () => void每当更改指定字段时,都会调用一个函数。它通过了新值和上一个值。
OnBlur每当指定的字段模糊时,请致电其children回调。它什么都没有。
name : String聆听的字段名称。
children: () => void每当指定字段模糊时都会调用一个函数。