@@ -199,12 +199,12 @@ export function createHydrationFunctions(
199
199
parentSuspense : SuspenseBoundary | null ,
200
200
optimized : boolean
201
201
) => {
202
- optimized = optimized || vnode . dynamicChildren !== null
202
+ optimized = optimized || ! ! vnode . dynamicChildren
203
203
const { props, patchFlag, shapeFlag, dirs } = vnode
204
204
// skip props & children if this is hoisted static nodes
205
205
if ( patchFlag !== PatchFlags . HOISTED ) {
206
206
// props
207
- if ( props !== null ) {
207
+ if ( props ) {
208
208
if (
209
209
! optimized ||
210
210
( patchFlag & PatchFlags . FULL_PROPS ||
@@ -215,24 +215,21 @@ export function createHydrationFunctions(
215
215
patchProp ( el , key , null , props [ key ] )
216
216
}
217
217
}
218
- } else if ( props . onClick != null ) {
218
+ } else if ( props . onClick ) {
219
219
// Fast path for click listeners (which is most often) to avoid
220
220
// iterating through props.
221
221
patchProp ( el , 'onClick' , null , props . onClick )
222
222
}
223
223
}
224
224
// vnode / directive hooks
225
225
let vnodeHooks : VNodeHook | null | undefined
226
- if ( ( vnodeHooks = props && props . onVnodeBeforeMount ) != null ) {
226
+ if ( ( vnodeHooks = props && props . onVnodeBeforeMount ) ) {
227
227
invokeVNodeHook ( vnodeHooks , parentComponent , vnode )
228
228
}
229
- if ( dirs != null ) {
229
+ if ( dirs ) {
230
230
invokeDirectiveHook ( vnode , null , parentComponent , 'beforeMount' )
231
231
}
232
- if (
233
- ( vnodeHooks = props && props . onVnodeMounted ) != null ||
234
- dirs != null
235
- ) {
232
+ if ( ( vnodeHooks = props && props . onVnodeMounted ) || dirs ) {
236
233
queueEffectWithSuspense ( ( ) => {
237
234
vnodeHooks && invokeVNodeHook ( vnodeHooks , parentComponent , vnode )
238
235
dirs && invokeDirectiveHook ( vnode , null , parentComponent , 'mounted' )
@@ -242,7 +239,7 @@ export function createHydrationFunctions(
242
239
if (
243
240
shapeFlag & ShapeFlags . ARRAY_CHILDREN &&
244
241
// skip if element has innerHTML / textContent
245
- ! ( props !== null && ( props . innerHTML || props . textContent ) )
242
+ ! ( props && ( props . innerHTML || props . textContent ) )
246
243
) {
247
244
let next = hydrateChildren (
248
245
el . firstChild ,
@@ -291,7 +288,7 @@ export function createHydrationFunctions(
291
288
parentSuspense : SuspenseBoundary | null ,
292
289
optimized : boolean
293
290
) : Node | null => {
294
- optimized = optimized || vnode . dynamicChildren !== null
291
+ optimized = optimized || ! ! vnode . dynamicChildren
295
292
const children = vnode . children as VNode [ ]
296
293
const l = children . length
297
294
let hasWarned = false
@@ -369,7 +366,7 @@ export function createHydrationFunctions(
369
366
const target = ( vnode . target = isString ( targetSelector )
370
367
? document . querySelector ( targetSelector )
371
368
: targetSelector )
372
- if ( target != null && vnode . shapeFlag & ShapeFlags . ARRAY_CHILDREN ) {
369
+ if ( target && vnode . shapeFlag & ShapeFlags . ARRAY_CHILDREN ) {
373
370
hydrateChildren (
374
371
target . firstChild ,
375
372
vnode ,
0 commit comments