atlantis
atlantis copied to clipboard
feat(components): De-dupe `Toast` by implementing an `id` prop
Motivations
Wanted to prevent a Toast
from appearing multiple times if the page re-renders. Change the id
type that already existed to a string so that we can have more freedom in terms of what it can be. Was worried that allowing it to be a number might lead to collisions with the incremental toastKey
state we had as its likely someone would use 1
or something as the id, which would be the same as auto generated one.
Changes
Added
- Implement an
id
for theshowToast
method that de-dupes the Toast component and makes sure its not displayed multiple times when the page re-renders.
In Atlantis we use Github's built in pull request reviews.