File tree 2 files changed +6
-1
lines changed
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) {
98
98
if ( this . props . getDispatch ) {
99
99
this . props . getDispatch ( this . props . dispatch ) ;
100
100
}
101
+ clearGetFormCacheForModel ( this . props . model ) ;
101
102
}
102
103
103
104
UNSAFE_componentWillReceiveProps ( nextProps ) {
@@ -409,7 +410,6 @@ function createFormClass(s = defaultStrategy) {
409
410
410
411
function mapStateToProps ( state , { model } ) {
411
412
const modelString = getModel ( model , state ) ;
412
- clearGetFormCacheForModel ( modelString ) ;
413
413
const form = s . getForm ( state , modelString ) ;
414
414
415
415
invariant ( form ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import sinon from 'sinon';
11
11
12
12
import isValid from '../src/form/is-valid' ;
13
13
import { defaultTestContexts , testCreateStore , testRender } from './utils' ;
14
+ import { clearGetFormCache } from '../src/utils/get-form' ;
14
15
15
16
import {
16
17
Form as _Form ,
@@ -69,6 +70,10 @@ Object.keys(testContexts).forEach((testKey) => {
69
70
const combineForms = testContext . combineForms ;
70
71
71
72
describe ( `<Form> component (${ testKey } context)` , ( ) => {
73
+ beforeEach ( ( ) => {
74
+ clearGetFormCache ( ) ;
75
+ } ) ;
76
+
72
77
describe ( 'wraps component if specified' , ( ) => {
73
78
const store = testCreateStore ( {
74
79
testForm : formReducer ( 'test' , object ) ,
You can’t perform that action at this time.
0 commit comments