We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 008684e commit 3786fe4Copy full SHA for 3786fe4
src/component.js
@@ -45,12 +45,14 @@ export default class SizeMe extends Component {
45
createComponent = config => {
46
this.SizeAware = withSize(config)(({ children }) => children)
47
}
48
+
49
+ onSize = size => this.setState({ size });
50
51
render() {
52
const { SizeAware } = this
53
const render = this.props.children || this.props.render
54
return (
- <SizeAware onSize={size => this.setState({ size })}>
55
+ <SizeAware onSize={this.onSize}>
56
{render({ size: this.state.size })}
57
</SizeAware>
58
)
0 commit comments