react-hot-toast icon indicating copy to clipboard operation
react-hot-toast copied to clipboard

Feature: configurable dismiss timer duration

Open StErMi opened this issue 3 years ago • 3 comments

At the moment the dismiss operation is delayed by 1000ms and that param is hardcoded into the code. Could it be something useful to configure?

StErMi avatar Apr 27 '21 08:04 StErMi

// show toast 3000ms
toast.success('some text', { duration: 3000 })

lemihthien avatar Apr 28 '21 06:04 lemihthien

Hi @lemihthien I'm not talking about the duration of the toast itself but the duration of the delay between dismissing (clicking on an X button) and the visual effect of dismissing it. That's hardcoded at 1 second here: https://github.com/timolins/react-hot-toast/blob/main/src/core/store.ts#L53

StErMi avatar Apr 28 '21 06:04 StErMi

We're using this in a project and customizing the delay duration is quite important for us - I'll try to open a PR for this :)

nfuad avatar Jun 11 '21 18:06 nfuad