react-native-root-toast icon indicating copy to clipboard operation
react-native-root-toast copied to clipboard

List Multiple Toast Messages

Open RonanMaguire opened this issue 1 year ago • 1 comments

Is it possible to have multiple stack messages appear in a list?

i.e. The use case would be to connect and then log an api request so it would be good if there was an ability to do this. At the moment the toast messages just appear over each other. Is there a way to show something like:

[Request Sent] [Successfully connected]

at the top of the screen e.g the success message appears then the request sent message comes after and shuffles the former message down the screen?

RonanMaguire avatar Jul 02 '24 14:07 RonanMaguire

you can make a simple taskQueue like this

let taskQueue = Promise.resolve();

export function addToMsgQueue(newMsg) {
  taskQueue = taskQueue.then(async () => {
      await someAnimationIn();
      showToast(newMsg);
      await someAnimationOut();
  });
}

sunnylqm avatar Jul 03 '24 02:07 sunnylqm