Skip to content
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

chore(custom-views): Switch to useLayoutEffect #76695

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions static/app/views/issueList/customViewsHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useContext, useEffect, useMemo, useState} from 'react';
import {useContext, useEffect, useLayoutEffect, useMemo, useState} from 'react';
import type {InjectedRouter} from 'react-router';
import styled from '@emotion/styled';
import debounce from 'lodash/debounce';
Expand Down Expand Up @@ -164,7 +164,7 @@ function CustomViewsIssueListHeaderTabsContent({
);

// This insane useEffect ensures that the correct tab is selected when the url updates
useEffect(() => {
useLayoutEffect(() => {
// If no query, sort, or viewId is present, set the first tab as the selected tab, update query accordingly
if (!query && !sort && !viewId) {
navigate({
Expand Down
Loading