Skip to content

[react, inertiajs] useEchoNotification notifications run multiple times after navigating the app #458

@thoresuenert

Description

@thoresuenert

Echo Version

2.2.3

Laravel Version

^12.0

PHP Version

8.4.5

NPM Version

10.9.2

Database Driver & Version

sqlite

Description

When you use the following hook:

useEchoNotifcation('App.Models.User.1', (notification) => {
console.log(notification.type);
} )

On a freshly loaded page everything forks fine.

When you navigating the app you will increase the registered callbacks with each inertiajs page visit.
When you now receive a notification the callback will output multiple console logs.

A similiar bug is mentioned in #271

Steps To Reproduce

https://github.com/suenerds/starter-kit-tinker

clone that repo an follow the readme.

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