@@ -3,7 +3,6 @@ import { recordify, TypedRecord } from "typed-immutable-record";
33import { Iterable } from "immutable" ;
44
55import { BaseContainer , BaseContainerProps } from "simplr-forms" ;
6- import { FormError } from "simplr-forms/contracts" ;
76
87export interface BaseFormButtonProps extends BaseContainerProps , React . HTMLProps < HTMLButtonElement > {
98 disableOnError ?: boolean ;
@@ -49,12 +48,10 @@ export abstract class BaseFormButton<TProps extends BaseFormButtonProps, TState
4948 // Type 'Readonly<TState>' cannot be converted to type 'Iterable<string, any>'.
5049 const stateIterable = this . state as any as Iterable < string , any > ;
5150 if ( ! newStateRecord . equals ( stateIterable ) ) {
52- this . setState ( ( prevState ) => {
53- // newStateRecord becomes an empty object after setState
54- // This happens because of an underlying Immutable.Record
55- // not enumerating properties in for..in
56- return newState ;
57- } ) ;
51+ // newStateRecord becomes an empty object after setState
52+ // This happens because of an underlying Immutable.Record
53+ // not enumerating properties in for..in
54+ this . setState ( ( ) => newState ) ;
5855 }
5956 }
6057
@@ -120,5 +117,5 @@ export abstract class BaseFormButton<TProps extends BaseFormButtonProps, TState
120117 return className . length > 0 ? className : undefined ;
121118 }
122119
123- abstract render ( ) : JSX . Element | null ;
120+ public abstract render ( ) : JSX . Element | null ;
124121}
0 commit comments