diff --git a/redux-form/lib/reduxForm.d.ts b/redux-form/lib/reduxForm.d.ts index 82efbd9cff..bcfafe2e3a 100644 --- a/redux-form/lib/reduxForm.d.ts +++ b/redux-form/lib/reduxForm.d.ts @@ -65,6 +65,12 @@ export interface Config { */ 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 diff --git a/redux-form/redux-form-tests.tsx b/redux-form/redux-form-tests.tsx index e660b6b0b5..f37e1e9815 100644 --- a/redux-form/redux-form-tests.tsx +++ b/redux-form/redux-form-tests.tsx @@ -56,3 +56,22 @@ const MyStatelessFunctionalComponent: React.SFC = () =>
; reduxForm({ form: 'mySFCForm' })(MyStatelessFunctionalComponent); + +class MyReusableForm extends Component { + render() { + return ( +
+ +
+ ); + } +} + +reduxForm({ + form: 'forceUnregisterOnMountForm', + forceUnregisterOnUnmount: true +});