Skip to content

2.0.0-beta.14 isPending() inside Loading > Errored fallback causes infinite loop #2790

Description

@dangkyokhoang

Describe the bug

As title, this pattern causes an infinite loop if the async resource still fails after resetting.

    <Loading fallback={<div>Loading...</div>}>
      <Errored
        fallback={(err, reset) => (
          <>
            <div>{String(err())}</div>
            <div>
              <button
                onClick={() => {
                  evict(key);
                  reset();
                }}
              >
                Reset
              </button>
              <Show when={isPending(data)}>
                <div>Resetting...</div>
              </Show>
            </div>
          </>
        )}
      >

Commenting out the <Show> inside <Errored fallback> works.

Your Example Website or App

https://stackblitz.com/edit/solidjs-templates-nt3kvm81?file=src%2FApp.tsx

Steps to Reproduce the Bug or Issue

  1. Go to the link above
  2. Click Refresh until it fails
  3. Click Reset
  4. Infinite loop

Expected behavior

No issue, should work.

Screenshots or Videos

No response

Platform

  • OS: Linux

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions