Skip to content

Commit

Permalink
force-update-fix use bind instead of arrow function to avoid making c…
Browse files Browse the repository at this point in the history
…ode larger in transpilation
  • Loading branch information
billneff79 committed Jan 29, 2018
1 parent d1d884b commit afdc746
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/preact-portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class Portal extends Component {
}

componentDidMount() {
this.renderLayer = this.renderLayer.bind(this);
this.renderLayer();
}

Expand All @@ -28,7 +29,7 @@ export default class Portal extends Component {
return typeof node==='string' ? document.querySelector(node) : node;
}

renderLayer = (show=true) => {
renderLayer(show=true) {
// clean up old node if moving bases:
if (this.props.into!==this.intoPointer) {
this.intoPointer = this.props.into;
Expand Down

0 comments on commit afdc746

Please sign in to comment.