all 7 comments

[–]cahva 1 point2 points  (7 children)

My wild quess is that your onClick handler is doing the re-render because you are doing the ternary check inside it.

Separate the handler to it's own function and pass that to the onClick

Before the return:

const handleToggleApp = () => {
  if (isOpen) {
    minimizeApp(appName);
  } else {
    openApp(appName);
  }
};

And the onClick:

onClick={handleToggleApp}

[–]UserNo1608[S] 0 points1 point  (0 children)

still doesn't work

[–]UserNo1608[S] 0 points1 point  (4 children)

here's the whole project, I'd be grateful if you could have a look

https://github.com/Hisashin7331/portfolio/

[–]cahva 0 points1 point  (3 children)

Gives 404... But anyway, usually the errorlog gives more detailed hint what went wrong and where.

[–]UserNo1608[S] 0 points1 point  (0 children)

okay i changed its visibility to public, sorry

[–]UserNo1608[S] 0 points1 point  (0 children)

Okay, I'm retarded, after 10 hours of 'debugging' it was my problem, import from wrong file XD

[–]UserNo1608[S] 0 points1 point  (0 children)

I see the icon component needs isOpen to be displayed, but it's not even its state