Skip to content

throw dataWith... is not working with React Router 7 #38

Closed
@jhiven

Description

@jhiven

throw dataWithToast() and throw await dataWithToast() is not working with React Router 7. I have tested it using a fresh new project template from React Router.

Steps to reproduce:

  • create a React Router 7 project with Framework Mode from the official docs.
  • install remix-toast
  • follow the usage guide from this repository (i use sonner)
  • just call throw dataWithToast() or throw await dataWithSuccess() in any loader.

Observed Behaviour:

throw dataWithToast() give this output in log:

Promise {
  DataWithResponseInit {
    type: 'DataWithResponseInit',
    data: null,
    init: {
      headers: Headers {
        'Set-Cookie': 'toast-session=...; Path=/; HttpOnly; SameSite=Lax'
      }
    }
  },
  [Symbol(async_id_symbol)]: 30172,
  [Symbol(trigger_async_id_symbol)]: 30125,
  [Symbol(kResourceStore)]: undefined
}

whereas throw await dataWithToast() didn't log anything

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