You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the first toast displayed at load flickers when you try to update it.
This is due to the Toast component being destroyed then recreated.
I thought it was on my part so I investigated the issue and found the bug. It was a long task but the bug itself is pretty trivial:
When creating a toast, you assign them a key in order to provide react with the key attribute here. The problem is that the first key is 0 and in the case of an update, while the first key is effectively retrieved from the ToastContainer, it does not pass this check here resulting in the key not being used and being incremented instead. The fix would simply be to set toastKey here to 1 instead of 0.
To reproduce, simply create a single toast, and try to update it before it vanishes. It should call onClose and cause a flicker and the screen. Sorry for not providing code but you have the fix instead ;)
The text was updated successfully, but these errors were encountered:
Well don't. This was an edge case and it could happen to anyone.
I know how hard and time consuming maintaining an open-source project is
Thank you for your reactivity
Keep up the good work !
Currently, the first toast displayed at load flickers when you try to update it.
This is due to the Toast component being destroyed then recreated.
I thought it was on my part so I investigated the issue and found the bug. It was a long task but the bug itself is pretty trivial:
When creating a toast, you assign them a key in order to provide react with the key attribute here. The problem is that the first key is 0 and in the case of an update, while the first key is effectively retrieved from the ToastContainer, it does not pass this check here resulting in the key not being used and being incremented instead. The fix would simply be to set toastKey here to 1 instead of 0.
To reproduce, simply create a single toast, and try to update it before it vanishes. It should call onClose and cause a flicker and the screen. Sorry for not providing code but you have the fix instead ;)
The text was updated successfully, but these errors were encountered: