atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

feat(components): De-dupe `Toast` by implementing an `id` prop

Open timoteialbu opened this issue 6 months ago • 2 comments

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 the showToast 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.

Random photo of Atlantis

timoteialbu avatar Aug 21 '24 18:08 timoteialbu