File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,17 @@ export default class List extends Component {
158
158
_cellRenderer ( { rowIndex, style, ...rest } ) {
159
159
const { rowRenderer } = this . props
160
160
161
- // By default, List cells should be 100% width.
162
- // This prevents them from flowing under a scrollbar (if present).
163
- style . width = '100%'
161
+ // TRICKY The style object is sometimes cached by Grid.
162
+ // This prevents new style objects from bypassing shallowCompare().
163
+ // However as of React 16, style props are auto-frozen (at least in dev mode)
164
+ // Check to make sure we can still modify the style before proceeding.
165
+ // https://github.com/facebook/react/commit/977357765b44af8ff0cfea327866861073095c12#commitcomment-20648713
166
+ const { writable } = Object . getOwnPropertyDescriptor ( style , 'width' )
167
+ if ( writable ) {
168
+ // By default, List cells should be 100% width.
169
+ // This prevents them from flowing under a scrollbar (if present).
170
+ style . width = '100%'
171
+ }
164
172
165
173
return rowRenderer ( {
166
174
index : rowIndex ,
You can’t perform that action at this time.
0 commit comments