File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,16 +80,18 @@ const withFilterHandler = ComponentToWrap => {
8080
8181 updateFilterConfig ( filterFunction , filterComponent , columnName ) {
8282 if ( columnName !== undefined ) {
83- let newState = { } ;
84- if ( filterFunction !== undefined ) {
85- newState . filterFunctions = Object . assign ( { } , this . state . filterFunctions ) ;
86- newState . filterFunctions [ columnName ] = filterFunction ;
87- }
88- if ( filterComponent !== undefined ) {
89- newState . filterComponents = Object . assign ( { } , this . state . filterComponents ) ;
90- newState . filterComponents [ columnName ] = filterComponent ;
91- }
92- this . setState ( newState ) ;
83+ this . setState ( ( prevState ) => {
84+ let newState = { } ;
85+ if ( filterFunction !== undefined ) {
86+ newState . filterFunctions = Object . assign ( { } , prevState . filterFunctions ) ;
87+ newState . filterFunctions [ columnName ] = filterFunction ;
88+ }
89+ if ( filterComponent !== undefined ) {
90+ newState . filterComponents = Object . assign ( { } , prevState . filterComponents ) ;
91+ newState . filterComponents [ columnName ] = filterComponent ;
92+ }
93+ return newState ;
94+ } ) ;
9395
9496 } else {
9597 let newState = { } ;
You can’t perform that action at this time.
0 commit comments