Skip to content

Commit 7a365a6

Browse files
committed
fix feedback type
1 parent c350bff commit 7a365a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

static/app/components/feedback/widget/useFeedbackWidget.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ interface Props {
1313

1414
export default function useFeedbackWidget({buttonRef, messagePlaceholder}: Props) {
1515
const config = useLegacyStore(ConfigStore);
16-
const feedback = Sentry.getFeedback();
16+
const feedback =
17+
Sentry.getClient()?.getIntegrationByName<
18+
ReturnType<typeof Sentry.feedbackIntegration>
19+
>('Feedback');
1720

1821
useEffect(() => {
1922
if (!feedback) {
@@ -30,9 +33,13 @@ export default function useFeedbackWidget({buttonRef, messagePlaceholder}: Props
3033

3134
if (buttonRef) {
3235
if (buttonRef.current) {
36+
// TODO: Remove this after we update to 8.0.0-beta.5
37+
// @ts-expect-error This is wrongly typed in the current version...
3338
return feedback.attachTo(buttonRef.current, options);
3439
}
3540
} else {
41+
// TODO: Remove this after we update to 8.0.0-beta.5
42+
// @ts-expect-error This is wrongly typed in the current version...
3643
const widgetPromise = feedback.createWidget(options);
3744
return async () => {
3845
const widget = await widgetPromise;

0 commit comments

Comments
 (0)