Skip to content

When toaster.promise is not provided a loading config, the app crashes #2542

@samturrell

Description

@samturrell

Description

When using toaster.promise and you pass an options object with no loading config, the app crashes.

In the console we are presented with two errors:

Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Toaster`.

and

Uncaught Error: [zag-js > toast] missing required props: id

When uncommenting the loading config in App.tsx the code runs as expected.

The types for the PromiseOptions mark this as optional, but seems to not be the case, or the code isn't handling it correctly.

This issue is also present in Chakra due to using the underlying Ark implementation.

Link to Reproduction (or Detailed Explanation)

https://codesandbox.io/p/devbox/weathered-currying-8h8yz6

Steps to Reproduce

  1. Click on "Add Toast" button
  2. Wait 0.5s for promise to resolve
  3. Observe the page crash
  4. Inspect the browser console to see the two errors detailed above

Ark UI Version

5.15.1

Framework

  • React
  • Solid
  • Vue
  • Svelte

Browser

Google Chrome

Additional Information

No response

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