-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ui): handle React 18 batching for "Submit" button on details page. Fixes #13453 #13593
Commits on Sep 12, 2024
-
fix(ui): Submit button grayed out on details page. Fixes argoproj#13453
The React 18 upgrade in argoproj#13069 introduced a bug on the details page where the "Submit" button is disabled immediately on page load. Specifically, I believe this is happening due to batching changes that affect the following two `useEffect()` calls, which are common to all the details pages modified in this PR: ``` useEffect(() => { (async () => { try { const newEventSource = await services.eventSource.get(name, namespace); setEventSource(newEventSource); setEdited(false); // set back to false setError(null); } catch (err) { setError(err); } })(); }, [name, namespace]); useEffect(() => setEdited(true), [eventSource]); ``` The first runs immediately and invokes `setEventSource(newEventSource)`, which causes the second `useEffect()` call to be fired, since the `eventSource` dependency has changed. Since both are invoking `setEdited()`, this is basically a race condition, since the state of `edited` is going to depend on whether these calls are batched together are fired separately. This PR fixes that by removing the second `useEffect()` call, which eliminates the race condition. Instead, we only call `setEdited(true)` when the editor is modified. Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fe7d6be - Browse repository at this point
Copy the full SHA fe7d6beView commit details
Commits on Sep 14, 2024
-
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2747d17 - Browse repository at this point
Copy the full SHA 2747d17View commit details -
fix(ui): cache using useMemo() and fix sensor-details.tsx
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1ef4958 - Browse repository at this point
Copy the full SHA 1ef4958View commit details
Commits on Sep 27, 2024
-
Merge branch 'main' into fix-13453
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c249458 - Browse repository at this point
Copy the full SHA c249458View commit details
Commits on Sep 28, 2024
-
refactor(ui): Extract to hook and delete deep Object comparison
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 24c0206 - Browse repository at this point
Copy the full SHA 24c0206View commit details -
Merge branch 'main' into fix-13453
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a54bbd3 - Browse repository at this point
Copy the full SHA a54bbd3View commit details
Commits on Sep 30, 2024
-
refactor: rename to useEditableObject and update comments
Signed-off-by: Mason Malone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cf9a3f3 - Browse repository at this point
Copy the full SHA cf9a3f3View commit details