-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add _force to internal.d.ts #1990
Conversation
constructor: preact.ComponentType<P>; | ||
state: S; // Override Component["state"] to not be readonly for internal use, specifically Hooks | ||
base?: PreactElement; | ||
|
||
_dirty: boolean; | ||
_renderCallbacks: Array<() => void>; | ||
_force?: boolean | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 53 to 70 in cd64450
this._force = false; | |
if (callback) this._renderCallbacks.push(callback); | |
enqueueRender(this); | |
} | |
}; | |
/** | |
* Immediately perform a synchronous re-render of the component | |
* @param {() => void} [callback] A function to be called after component is | |
* re-rendered | |
*/ | |
Component.prototype.forceUpdate = function(callback) { | |
if (this._vnode) { | |
// Set render mode so that we can differentiate where the render request | |
// is coming from. We need this because forceUpdate should never call | |
// shouldComponentUpdate | |
if (callback) this._renderCallbacks.push(callback); | |
this._force = true; |
Lines 149 to 151 in cd64450
c._force = null; | |
} |
// this._vnode = null; | ||
// this._nextState = null; // Only class components | ||
// this._processingException = null; // Always read, set only when handling error | ||
// this._pendingError = null; // Always read, set only when handling error. This is used to indicate at diffTime to set _processingException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is the same role as the type definition.
Therefore, I think it is better that this comment moves to type definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking this up! You're very prompt in these follow-ups! Much appreciated
No description provided.