How to get a handle to internal mounted state for checking if it first render or not?
ahmetkca opened this issue · comments
is there a way to get the internal mounted
state to check if it is first render or not? From what I understand sonner already renders your custom component ones for triggering css animations.
React.useEffect(() => {
// Trigger enter animation without using CSS animation
setMounted(true);
}, []);
What's your use case?
I had a toast. Promise toast where I show progress of the uploads of the files. I was passing promises and doing some state update whenever a promise is resolved. I was updating the states twice the size of promise list somehow and I thought this was the problem. Fortunately, I resolved by creating my own first render check with useRef.