Do you want to request a feature or report a bug?
bug
What is the current behavior?
toast notifications don't get shown after route-change
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
dependencies:
step 1: load page and click "open toast" --> works
step 2: make a route-change
step 3: click "open toast" --> doesn't work
step 4: reload page and click "open toast" --> works again
https://codesandbox.io/s/gatsby-starter-default-lh4o3
What is the expected behavior?
toast notifications should be shown
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
worked in previous version of this package (5.3.2)
I solved this issue by putting the ToastContainer inside my highest level component (where my router is), that way all toast function calls are passed into that Container only. I'm guessing what's going on after debugging my app is that the toast message's aren't going to the correct Container when you switch between routes.
@herrwitzi hi, getting same error with your exact scenario. this just start to happen after latest version update of gatsby.
@AirrBear it was just like that but nope still not working :(
so anybody? :)
Thanks @AirrBear Your work around working for me.
May I ask you to try with the v5.5.0 if it solve your issue.
Thanks
@fkhadra this issue seems to be fixed with v5.5.0. Thanks!
Most helpful comment
I solved this issue by putting the ToastContainer inside my highest level component (where my router is), that way all toast function calls are passed into that Container only. I'm guessing what's going on after debugging my app is that the toast message's aren't going to the correct Container when you switch between routes.