Files
twenty/packages/twenty-front
Baptiste Devessier 1ba0c24071 Set the page hotkey scope only once (#11626)
The `useEffect` in the `PageChangeEffect` component that sets the page's
hotkey scope is run 4-5 times every time the page changes. It should be
executed only once when the location changes. The re-runs are due to
unstable dependencies that shouldn't re-trigger the `useEffect`.

This PR minimizes the re-runs of the `useEffect`. In the following
video, I discuss a more global pattern.

The documentation for the `useEffectEvent` hook:
https://react.dev/learn/separating-events-from-effects#extracting-non-reactive-logic-out-of-effects.


https://github.com/user-attachments/assets/8c0c238b-f1c4-4bbb-b083-0825f7176599
2025-04-17 16:57:49 +02:00
..
2025-01-03 15:18:02 +01:00
2025-04-09 17:35:25 +02:00
2025-04-17 16:03:51 +02:00
2025-04-09 01:03:43 +02:00
2025-04-17 16:03:51 +02:00
2025-04-17 16:03:51 +02:00
2025-04-15 13:32:12 +02:00
2025-04-16 17:49:04 +02:00

Run yarn dev while server running on port 3000