@@ -14,16 +14,16 @@ const GUTTER_SIZE = 3
1414const CELL_WIDTH = 75
1515
1616export default class CollectionExample extends Component {
17- static propTypes = {
17+ static contextTypes = {
1818 list : PropTypes . instanceOf ( Immutable . List ) . isRequired
19- }
19+ } ;
2020
2121 constructor ( props , context ) {
2222 super ( props , context )
2323
2424 this . state = {
25- cellCount : props . list . size ,
26- columnCount : this . _getColumnCount ( props . list . size ) ,
25+ cellCount : context . list . size ,
26+ columnCount : this . _getColumnCount ( context . list . size ) ,
2727 height : 300 ,
2828 horizontalOverscanSize : 0 ,
2929 scrollToCell : undefined ,
@@ -47,7 +47,7 @@ export default class CollectionExample extends Component {
4747 const { cellCount, height, horizontalOverscanSize, scrollToCell, showScrollingPlaceholder, verticalOverscanSize } = this . state
4848
4949 return (
50- < ContentBox { ... this . props } >
50+ < ContentBox >
5151 < ContentBoxHeader
5252 text = 'Collection'
5353 sourceLink = 'https://github.com/bvaughn/react-virtualized/blob/master/source/Collection/Collection.example.js'
@@ -131,7 +131,7 @@ export default class CollectionExample extends Component {
131131 }
132132
133133 _cellRenderer ( { index, isScrolling, key, style } ) {
134- const { list } = this . props
134+ const { list } = this . context
135135 const { showScrollingPlaceholder } = this . state
136136
137137 const datum = list . get ( index % list . size )
@@ -151,7 +151,7 @@ export default class CollectionExample extends Component {
151151 }
152152
153153 _cellSizeAndPositionGetter ( { index } ) {
154- const { list } = this . props
154+ const { list } = this . context
155155 const { columnCount } = this . state
156156
157157 const columnPosition = index % ( columnCount || 1 )
0 commit comments