Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
atellmer committed May 20, 2024
1 parent 121debd commit c07719b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/view/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export type TagVirtualNodeFactory = () => TagVirtualNode;

export type PlainVirtualNode = TextVirtualNode | CommentVirtualNode;

export type CanHasChildren = TagVirtualNode | Component;
export type CanHaveChildren = TagVirtualNode | Component;

export type ViewOptions = {
as: string;
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/workloop/workloop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { type Component, detectIsComponent } from '../component';
import { type ElementKey, type Instance, type Callback } from '../shared';
import { Fiber, getHook, Hook } from '../fiber';
import {
type CanHasChildren,
type CanHaveChildren,
Text,
detectIsVirtualNode,
detectIsVirtualNodeFactory,
Expand Down Expand Up @@ -107,7 +107,7 @@ function performUnitOfWork(fiber: Fiber, $scope: Scope): Fiber | null {
const isDeepWalking = $scope.getMountDeep();
const isStream = $scope.getIsStreamZone();
const emitter = $scope.getEmitter();
const children = (fiber.inst as CanHasChildren).children;
const children = (fiber.inst as CanHaveChildren).children;
const hasChildren = isDeepWalking && children && children.length > 0;

fiber.hook && (fiber.hook.idx = 0);
Expand Down Expand Up @@ -141,7 +141,7 @@ function mountChild(parent: Fiber, $scope: Scope) {
const $hook = parent.child ? parent.child.hook || null : null; // from previous fiber after throwing promise
const $inst = parent.inst;
const idx = 0;
const children = ($inst as CanHasChildren).children;
const children = ($inst as CanHaveChildren).children;
const inst = setupInstance(children, idx);
const alt = getAlternate(parent, inst, idx, $scope);
const fiber = createFiber(alt, inst, idx);
Expand All @@ -161,7 +161,7 @@ function mountSibling(left: Fiber, $scope: Scope) {
const $hook = left.next ? left.next.hook || null : null; // from previous fiber after throwing promise
const $inst = left.parent.inst;
const idx = $scope.getMountIndex();
const children = ($inst as CanHasChildren).children;
const children = ($inst as CanHaveChildren).children;
const inst = setupInstance(children, idx);
const hasSibling = Boolean(inst);

Expand Down Expand Up @@ -268,7 +268,7 @@ function getAlternate(fiber: Fiber, inst: Instance, idx: number, $scope: Scope)
function reconcile(fiber: Fiber, alt: Fiber, $scope: Scope) {
const { id, inst } = fiber;
const areSameTypes = detectAreSameInstanceTypes(alt.inst, inst);
const nextChildren = (inst as CanHasChildren).children;
const nextChildren = (inst as CanHaveChildren).children;

if (!areSameTypes) {
$scope.addDeletion(alt);
Expand Down Expand Up @@ -532,7 +532,7 @@ function commit($scope: Scope) {
$scope.runInsertionEffects();

for (const fiber of candidates) {
const item = fiber.inst as CanHasChildren;
const item = fiber.inst as CanHaveChildren;

fiber.tag !== SKIP_EFFECT_TAG && platform.commit(fiber);
fiber.alt = null;
Expand Down

0 comments on commit c07719b

Please sign in to comment.