mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
[redux-form] Added an optional "forceUnregisterOnUnmount" property to the
"reduxForm()" "Config" interface, as it is present in the redux-form API.
This commit is contained in:
Vendored
+6
@@ -65,6 +65,12 @@ export interface Config<FormData extends DataShape, P, S> {
|
||||
*/
|
||||
destroyOnUnmount?: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not to force unregistration of fields -- use in conjunction
|
||||
* with destroyOnUnmount.
|
||||
*/
|
||||
forceUnregisterOnUnmount?: boolean;
|
||||
|
||||
/**
|
||||
* A function that takes the entire Redux state and returns the state slice
|
||||
* which corresponds to where the redux-form reducer was mounted. This
|
||||
|
||||
@@ -56,3 +56,22 @@ const MyStatelessFunctionalComponent: React.SFC<void> = () => <div/>;
|
||||
reduxForm({
|
||||
form: 'mySFCForm'
|
||||
})(MyStatelessFunctionalComponent);
|
||||
|
||||
class MyReusableForm extends Component<void, undefined> {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Field
|
||||
name='foo'
|
||||
component='input'
|
||||
placeholder='Foo bar'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
reduxForm({
|
||||
form: 'forceUnregisterOnMountForm',
|
||||
forceUnregisterOnUnmount: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user