11import React from 'react' ;
22import PureRenderMixin from 'react-addons-pure-render-mixin' ;
33import PropTypes from '../utils/prop-types' ;
4- import Paper from '../paper' ;
54import getMuiTheme from '../styles/getMuiTheme' ;
65import Subheader from '../Subheader' ;
76import deprecated from '../utils/deprecatedPropType' ;
7+ import warning from 'warning' ;
88
99const List = React . createClass ( {
1010
@@ -39,7 +39,9 @@ const List = React.createClass({
3939 'Refer to the `subheader` property.' ) ,
4040
4141 /**
42- * The zDepth prop passed to the Paper element inside list.
42+ * @ignore
43+ * ** Breaking change ** List no longer supports `zDepth`. Instead, wrap it in `Paper`
44+ * or another component that provides zDepth.
4345 */
4446 zDepth : PropTypes . zDepth ,
4547 } ,
@@ -56,12 +58,6 @@ const List = React.createClass({
5658 PureRenderMixin ,
5759 ] ,
5860
59- getDefaultProps ( ) {
60- return {
61- zDepth : 0 ,
62- } ;
63- } ,
64-
6561 getInitialState ( ) {
6662 return {
6763 muiTheme : this . context . muiTheme || getMuiTheme ( ) ,
@@ -91,6 +87,9 @@ const List = React.createClass({
9187 ...other ,
9288 } = this . props ;
9389
90+ warning ( ( typeof zDepth === 'undefined' ) , 'List no longer supports `zDepth`. Instead, wrap it in `Paper` ' +
91+ 'or another component that provides zDepth.' ) ;
92+
9493 let hasSubheader = false ;
9594
9695 if ( subheader ) {
@@ -111,14 +110,13 @@ const List = React.createClass({
111110 } ;
112111
113112 return (
114- < Paper
113+ < div
115114 { ...other }
116115 style = { Object . assign ( styles . root , style ) }
117- zDepth = { zDepth }
118116 >
119117 { subheader && < Subheader inset = { insetSubheader } style = { subheaderStyle } > { subheader } </ Subheader > }
120118 { children }
121- </ Paper >
119+ </ div >
122120 ) ;
123121 } ,
124122} ) ;
0 commit comments