diff --git a/src/core/reconciler.js b/src/core/reconciler.js index f3979d10..e3e7bf55 100644 --- a/src/core/reconciler.js +++ b/src/core/reconciler.js @@ -17,6 +17,7 @@ import { getInstanceFromNode } from '../helpers/getInstanceFromNode.js'; import { getInstanceFromScope } from '../helpers/getInstanceFromScope.js'; import { getPublicInstance } from '../helpers/getPublicInstance.js'; import { getRootHostContext } from '../helpers/getRootHostContext.js'; +import { hideInstance } from '../helpers/hideInstance.js'; import { insertBefore } from '../helpers/insertBefore.js'; import { prepareForCommit } from '../helpers/prepareForCommit.js'; import { preparePortalMount } from '../helpers/preparePortalMount.js'; @@ -25,6 +26,7 @@ import { prepareUpdate } from '../helpers/prepareUpdate.js'; import { removeChild } from '../helpers/removeChild.js'; import { resetAfterCommit } from '../helpers/resetAfterCommit.js'; import { shouldSetTextContent } from '../helpers/shouldSetTextContent.js'; +import { unhideInstance } from '../helpers/unhideInstance.js'; /** @typedef {import('../typedefs/HostConfig.ts').HostConfig} HostConfig */ /** @typedef {import('../typedefs/Instance.ts').Instance} Instance */ @@ -71,6 +73,7 @@ const reconcilerConfig = { getInstanceFromScope, getPublicInstance, getRootHostContext, + hideInstance, insertBefore, insertInContainerBefore: insertBefore, prepareForCommit, @@ -82,6 +85,7 @@ const reconcilerConfig = { resetAfterCommit, scheduleTimeout: setTimeout, shouldSetTextContent, + unhideInstance, }; const reconciler = Reconciler(reconcilerConfig); diff --git a/src/helpers/hideInstance.js b/src/helpers/hideInstance.js new file mode 100644 index 00000000..0da8b0c0 --- /dev/null +++ b/src/helpers/hideInstance.js @@ -0,0 +1,9 @@ +/** @typedef {import('../typedefs/Instance.ts').Instance} Instance */ + +/** + * @param {Instance} instance + */ +export function hideInstance(instance) +{ + instance.visible = false; +} diff --git a/src/helpers/unhideInstance.js b/src/helpers/unhideInstance.js new file mode 100644 index 00000000..09ee88e7 --- /dev/null +++ b/src/helpers/unhideInstance.js @@ -0,0 +1,9 @@ +/** @typedef {import('../typedefs/Instance.ts').Instance} Instance */ + +/** + * @param {Instance} instance + */ +export function unhideInstance(instance) +{ + instance.visible = true; +}