alan2207 / bulletproof-react

🛡️ ⚛️ A simple, scalable, and powerful architecture for building production ready React applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notification transition not working

speccaN opened this issue · comments

The notification popups are not triggering their transition, they just instantly appears and disappears.

Do you have any idea what might be the issue?
Tried on macOS Monterey and Windows 10
Chrome and Safari

I managed to do a workaround like this (not the prettiest, but it works)

Notification.tsx

 const [show, setShow] = React.useState(false);

  React.useEffect(() => {
    setTimeout(() => {
      setShow(true);
    }, 50);
  }, []);

      <Transition
          show={show}
          /*...*/
        >
...

<button                
onClick={() => {
      setShow(false);
      setTimeout(() => {
        onDismiss(id);
      }, 100);
    }}}

It's because the <Transition>-element is missing the appear={true} property.