Skip to content

Commit 5864ba1

Browse files
committed
fix: move null check for titles to fix hooks error order
1 parent cea602e commit 5864ba1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/pages/Video/components/TitleDropdownNew.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ export const TitleDropdown = ({
3333
const { campaignId } = useParams();
3434
const [addVideoTags] = usePostCampaignsByCidVideoTagsMutation();
3535
const titleMaxLength = 70;
36-
37-
if (!titles) {
38-
return null;
39-
}
40-
4136
const options: ComponentProps<typeof Autocomplete>['options'] = useMemo(
4237
() =>
4338
(titles || []).map((i) => ({
@@ -75,6 +70,10 @@ export const TitleDropdown = ({
7570
[titles, formProps.values.title]
7671
);
7772

73+
if (!titles) {
74+
return null;
75+
}
76+
7877
return (
7978
<Field>
8079
<Autocomplete

0 commit comments

Comments
 (0)