Skip to content

createScriptLoader triggers a warning about disposed computations #746

@sfnmk

Description

@sfnmk

Describe the bug

When using createScriptLoader a warning is shown that reads:

computations created outside a createRoot or render will never be disposed

should I wrap the createScriptLoader around some other function? Currently I'm using it like this:

const MainLayout = (props: RouteSectionProps) => {
  createScriptLoader({
    src: '<insert-script-url>',
    crossOrigin: 'anonymous',
  })

  return (
    <MetaProvider>
      <Navbar />
      <div class="flex h-screen-nav">
        <SideNav />
        <main class="flex-grow h-full p-4 overflow-hidden">
          <Suspense>{props.children}</Suspense>
        </main>
      </div>
    </MetaProvider>
  )
}

export default MainLayout

Minimal Reproduction Link

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions