This repository was archived by the owner on Aug 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ function createFormClass(s = defaultStrategy) {
9898 if ( this . props . getDispatch ) {
9999 this . props . getDispatch ( this . props . dispatch ) ;
100100 }
101+ clearGetFormCacheForModel ( this . props . model ) ;
101102 }
102103
103104 UNSAFE_componentWillReceiveProps ( nextProps ) {
@@ -409,7 +410,6 @@ function createFormClass(s = defaultStrategy) {
409410
410411 function mapStateToProps ( state , { model } ) {
411412 const modelString = getModel ( model , state ) ;
412- clearGetFormCacheForModel ( modelString ) ;
413413 const form = s . getForm ( state , modelString ) ;
414414
415415 invariant ( form ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import sinon from 'sinon';
1111
1212import isValid from '../src/form/is-valid' ;
1313import { defaultTestContexts , testCreateStore , testRender } from './utils' ;
14+ import { clearGetFormCache } from '../src/utils/get-form' ;
1415
1516import {
1617 Form as _Form ,
@@ -69,6 +70,10 @@ Object.keys(testContexts).forEach((testKey) => {
6970 const combineForms = testContext . combineForms ;
7071
7172 describe ( `<Form> component (${ testKey } context)` , ( ) => {
73+ beforeEach ( ( ) => {
74+ clearGetFormCache ( ) ;
75+ } ) ;
76+
7277 describe ( 'wraps component if specified' , ( ) => {
7378 const store = testCreateStore ( {
7479 testForm : formReducer ( 'test' , object ) ,
You can’t perform that action at this time.
0 commit comments