Skip to content

Commit

Permalink
Add comments to useTimeout() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Onitoxan committed Jan 21, 2025
1 parent 5beda13 commit dfa8d62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export const FilterFlowsTable = (props: Props) => {
if (query.filters !== encodedFilters) {
handleAbortController();
}
// We need to delay this action in a synchronous way to avoid
// calling 2 setState() actions in an uncontrolled way that could
// mess with internal React's component update cycle
setTimeout(() => {
setQuery({
...query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export const FilterOrganizationsTable = (props: Props) => {
) => void
) => {
formikResetForm();
// We need to delay this action in a synchronous way to avoid
// calling 2 setState() actions in an uncontrolled way that could
// mess with internal React's component update cycle
setTimeout(() => {
setQuery({
...query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const FilterPendingFlowsTable = (props: Props) => {
if (query.filters !== encodedFilters) {
handleAbortController();
}
// We need to delay this action in a synchronous way to avoid
// calling 2 setState() actions in an uncontrolled way that could
// mess with internal React's component update cycle
setTimeout(() => {
setQuery({
...query,
Expand Down

0 comments on commit dfa8d62

Please sign in to comment.