File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,4 @@ function Cell<RecordType extends DefaultRecordType>(
187
187
const RefCell = React . forwardRef ( Cell ) ;
188
188
RefCell . displayName = 'Cell' ;
189
189
190
- const MemoCell = React . memo ( RefCell ) ;
191
- MemoCell . displayName = 'Cell' ;
192
-
193
- export default MemoCell ;
190
+ export default RefCell ;
Original file line number Diff line number Diff line change @@ -766,4 +766,27 @@ describe('Table.Basic', () => {
766
766
. props ( ) [ 'data-row-key' ] ,
767
767
) . toEqual ( 'light' ) ;
768
768
} ) ;
769
+
770
+ it ( 'render with state change' , ( ) => {
771
+ class Test extends React . Component {
772
+ state = {
773
+ change : false ,
774
+ columns : [
775
+ {
776
+ render : ( ) => String ( this . state . change ) ,
777
+ } ,
778
+ ] ,
779
+ } ;
780
+
781
+ render ( ) {
782
+ return < Table columns = { this . state . columns } data = { [ { key : 1 } ] } /> ;
783
+ }
784
+ }
785
+
786
+ const wrapper = mount ( < Test /> ) ;
787
+ expect ( wrapper . find ( 'td' ) . text ( ) ) . toEqual ( 'false' ) ;
788
+
789
+ wrapper . setState ( { change : true } ) ;
790
+ expect ( wrapper . find ( 'td' ) . text ( ) ) . toEqual ( 'true' ) ;
791
+ } ) ;
769
792
} ) ;
You can’t perform that action at this time.
0 commit comments