Skip to content

Commit 8631109

Browse files
committed
Cleanup
1 parent 1f1e648 commit 8631109

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

packages/component/src/BasicScrollToBottom.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ const ROOT_CSS = css({
1313

1414
export default props =>
1515
<Composer>
16-
<Context>
17-
{ context =>
18-
<div className={ classNames(ROOT_CSS + '', props.className) }>
19-
<Panel>
20-
{ props.children }
21-
</Panel>
22-
<AutoHideFollowButton className={ props.followButtonClassName } />
23-
</div>
24-
}
25-
</Context>
16+
<div className={ classNames(ROOT_CSS + '', props.className) }>
17+
<Panel>
18+
{ props.children }
19+
</Panel>
20+
<AutoHideFollowButton className={ props.followButtonClassName } />
21+
</div>
2622
</Composer>

packages/component/src/ScrollToBottom/Composer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ export default class ScrollToBottomComposer extends React.Component {
2020
})),
2121
scrollTop: null,
2222
setTarget: target => this.setState(() => ({ target })),
23-
target: null,
23+
target: null
2424
};
2525
}
2626

2727
handleScroll() {
28-
this.setState(() => {
29-
const { target } = this.state;
30-
28+
this.setState(({ target }) => {
3129
if (target) {
3230
const { offsetHeight, scrollHeight, scrollTop } = target;
3331
const bottom = scrollHeight - scrollTop - offsetHeight <= this.props.threshold;

0 commit comments

Comments
 (0)