Skip to content

Commit a5937c2

Browse files
nsdeschenesClaude Sonnet 4
andcommitted
fix(compactSelect): Fix TypeScript errors in CompositeSelect MDX docs
Add SelectKey type import and annotate useState calls with explicit types to resolve TS2322 and TS2345 errors surfaced by typecheck:mdx. Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
1 parent 71339f1 commit a5937c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

static/app/components/core/compactSelect/composite.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resources:
1414

1515
import {useState} from 'react';
1616

17-
import {CompositeSelect} from '@sentry/scraps/compactSelect';
17+
import {CompositeSelect, type SelectKey} from '@sentry/scraps/compactSelect';
1818
import {OverlayTrigger} from '@sentry/scraps/overlayTrigger';
1919

2020
import {IconSentry} from 'sentry/icons';
@@ -132,8 +132,8 @@ Use `<CompositeSelect.ClearButton>` in `menuHeaderTrailingItems` to add a "Clear
132132
Only render the button when there is an active selection to clear.
133133

134134
export function ClearButtonDemo() {
135-
const [month, setMonth] = useState(null);
136-
const [tags, setTags] = useState([]);
135+
const [month, setMonth] = useState<SelectKey | null>(null);
136+
const [tags, setTags] = useState<string[]>([]);
137137
const monthOptions = [
138138
{value: 'jan', label: 'January'},
139139
{value: 'feb', label: 'February'},

0 commit comments

Comments
 (0)