Skip to content

Commit d768a13

Browse files
committed
Merge pull request #3612 from mbrookes/list-remove-paper
[List] Remove Paper
2 parents 0f9b467 + bab61a2 commit d768a13

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import MUI from 'material-ui' // no changes here 😀
1515

1616
- [Styles] RaisedButton, FlatButton, and FloatingActionButton now properly use primary/secondary colors
1717
- [Menu] Remove Paper (#3559)
18+
- [List] Remove Paper (#3612)
1819

1920
## 0.15.0-alpha.1
2021
###### _Feb 27, 2016_

src/lists/list.jsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
22
import PureRenderMixin from 'react-addons-pure-render-mixin';
33
import PropTypes from '../utils/prop-types';
4-
import Paper from '../paper';
54
import getMuiTheme from '../styles/getMuiTheme';
65
import Subheader from '../Subheader';
76
import deprecated from '../utils/deprecatedPropType';
7+
import warning from 'warning';
88

99
const 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

Comments
 (0)