79460157

Date: 2025-02-22 19:19:15
Score: 0.5
Natty:
Report link

It doesn't seem like you need short-circuit evaluation (when setSrc(`/imgs/${img}\`) isn't evaluated if setModalVisible(true); is true) so you can just do something like this:

onClick={() => {
  setModalVisible(true);
  setSrc(`/imgs/${img}`);
}}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: proof-of-correctness