Skip to content

Variable Scope looks wrong #184

@karianpour

Description

@karianpour

https://github.com/romkor/svelte-portal/blob/bddbc7c6d95c84b073b05319646ee25cdec3e5a5/src/Portal.svelte#L11C9-L11C17

I guess that "targetEl" variable can be defined inside the "update" function as follow:

  export function portal(el, target = "body") {
-    let targetEl;
    async function update(newTarget) {
-      target = newTarget;
+    let targetEl;
      if (typeof target === "string") {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions