Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: compress hookID #1371

Merged
merged 1 commit into from
Sep 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/rax/src/vdom/reactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class ReactiveComponent extends Component {

// A pure function
this.__render = pureRender;
this._hookID = 0;
this.__hookID = 0;
// Number of rerenders
this.__reRenders = 0;
this.__hooks = {};
Expand Down Expand Up @@ -59,7 +59,7 @@ export default class ReactiveComponent extends Component {
}

getHookID() {
return ++this._hookID;
return ++this.__hookID;
}

readContext(context) {
Expand Down Expand Up @@ -118,7 +118,7 @@ export default class ReactiveComponent extends Component {
Host.measurer && Host.measurer.beforeRender();
}

this._hookID = 0;
this.__hookID = 0;
this.__reRenders = 0;
this.__isScheduled = false;
let children = this.__render(this.props, this.forwardRef ? this.forwardRef : this.context);
Expand All @@ -133,7 +133,7 @@ export default class ReactiveComponent extends Component {
}
}

this._hookID = 0;
this.__hookID = 0;
this.__isScheduled = false;
children = this.__render(this.props, this.forwardRef ? this.forwardRef : this.context);
}
Expand Down