Skip to content

Commit d7ba58a

Browse files
committed
Removed the stats prop from ContainerQuery.
1 parent c56d421 commit d7ba58a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1717
[use-resize-observer](https://github.com/ZeeCoder/use-resize-observer) packages.
1818
- Removed the default export. (Both ContainerQuery and withContainerQuery is
1919
still available as named exports.)
20+
- Removed the `stats` prop from ContainerQuery. (Use `meta` instead.)
2021

2122
## [3.0.0-alpha.1]
2223

packages/react-container-query/src/ContainerQuery.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,23 @@ export default class ContainerQuery extends Component {
2626
};
2727

2828
componentDidMount() {
29-
if (!this.props.meta && !this.props.stats) {
29+
if (!this.props.meta) {
3030
return;
3131
}
3232

3333
this.lastContainer = ReactDOM.findDOMNode(this);
34-
const meta = this.props.meta || this.props.stats;
35-
new Container(this.lastContainer, meta, this.containerOptions);
34+
new Container(this.lastContainer, this.props.meta, this.containerOptions);
3635
}
3736

3837
componentDidUpdate() {
39-
if (!this.props.meta && !this.props.stats) {
38+
if (!this.props.meta) {
4039
return;
4140
}
4241

43-
const meta = this.props.meta || this.props.stats;
44-
4542
const element = ReactDOM.findDOMNode(this);
4643
if (this.lastContainer !== element) {
4744
this.lastContainer = element;
48-
new Container(this.lastContainer, meta, this.containerOptions);
45+
new Container(this.lastContainer, this.props.meta, this.containerOptions);
4946
}
5047
}
5148

@@ -65,13 +62,11 @@ export default class ContainerQuery extends Component {
6562
}
6663

6764
ContainerQuery.defaultProps = {
68-
stats: null,
6965
meta: null,
7066
options: {}
7167
};
7268

7369
ContainerQuery.propTypes = {
74-
stats: PropTypes.object,
7570
meta: PropTypes.object,
7671
options: PropTypes.object,
7772
children: PropTypes.oneOfType([PropTypes.element, PropTypes.func])

0 commit comments

Comments
 (0)