Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Prev Previous commit
Next Next commit
chore: improve code
  • Loading branch information
edison1105 committed May 2, 2023
commit 3dc4e4416db3ca404f6ee0c1f2b8a0afbd23433f
3 changes: 1 addition & 2 deletions 3 packages/runtime-core/src/h.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ export function h<P>(
export function h(type: any, propsOrChildren?: any, children?: any): VNode {
// #6913 disable tracking block in h function
const doCreateVNode = (type: any, props?: any, children?: any) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just stumbled upon this as I was reading the changelog. Is there a reason why every call to h will now (afaik) create an inline version of doCreateVNode? Can't this be created outside of the scope of calling h()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I made some simplifications to the h function and removed the doCreateVNode function. See #13841

let vnode: VNode
setBlockTracking(-1)
vnode = createVNode(type, props, children)
const vnode = createVNode(type, props, children)
setBlockTracking(1)
return vnode
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.