-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Update type definition #1581
Update type definition #1581
Conversation
function render( | ||
vnode: ComponentChild, | ||
parent: Element | Document | ShadowRoot | DocumentFragment, | ||
replaceNode?: Element | Text |
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.
@@ -25,6 +25,7 @@ export interface PreactElement extends HTMLElement { | |||
export interface VNode<P = {}> extends preact.VNode<P> { | |||
// Redefine type here using our internal ComponentFactory type | |||
type: string | ComponentFactory<P> | null; | |||
_self: this; |
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.
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.
The thing about _self is that it’s an internal. That’s why it’s not exposed
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.
Wohoo ✔️ 🎉 Declaring _self
is perfectly fine because that's why we have both index.d.ts
and internal.d.ts
👍
* upstream/master: (341 commits) Revert "Simplify originalDom check (-4 B) " Simplify originalDom check (-4 B) Add back mistakenly removed JSDoc comment Remove unnecessary code from `diffChildren` (-16 B) Golf createContext (-6 B) Fix useContext test spacing Remove `dom` parameter from `diff()` (-11 B) Move all component diff'ing logic into component diff condition (-6 B) fix issue by marking dirty before .render since this can potentially add another entry on the render queue add relevant test (chore) - remove focusElement (preactjs#1548) Update type definition (preactjs#1581) Compress code, assume EMPTY_OBJ._children == null Refactor out variables from diffChildren Compress diffChildren further Compress diffChildren further Condense code in diffChildren Fix infinite loop because of props mutation (preactjs#1577) (fix) - Error boundary not applying in array cases (preactjs#1572) Add styled-components example (preactjs#1574) ... # Conflicts: # .eslintignore # compat/mangle.json # compat/src/index.js # compat/src/internal.d.ts # debug/mangle.json # hooks/src/index.d.ts # hooks/src/index.js # hooks/src/internal.d.ts # mangle.json # package.json # src/component.js # src/constants.js # src/create-context.js # src/create-element.js # src/diff/children.js # src/diff/index.js # src/diff/props.js # src/index.d.ts # src/internal.d.ts # src/jsx.d.ts # src/render.js # src/util.js
This updates type definition.