File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,29 @@ feedback.attachTo(document.querySelector('#your-button'), {
203203});
204204```
205205
206+ Alternatively you can call ` feedback.openDialog() ` :
207+
208+ ``` typescript
209+ import {BrowserClient , getCurrentHub } from ' @sentry/react' ;
210+ import {Feedback } from ' @sentry-internal/feedback' ;
211+
212+ function MyFeedbackButton() {
213+ const client = hub && getCurrentHub ().getClient <BrowserClient >();
214+ const feedback = client ?.getIntegration (Feedback );
215+
216+ // Don't render custom feedback button if Feedback integration not installed
217+ if (! feedback ) {
218+ return null ;
219+ }
220+
221+ return (
222+ < button type = " button" onClick = {() => feedback.openDialog()}>
223+ Give me feedback
224+ < / button >
225+ )
226+ }
227+ ```
228+
206229### Bring Your Own Widget
207230
208231You can also bring your own widget and UI and simply pass a feedback object to the ` sendFeedback() ` function.
You can’t perform that action at this time.
0 commit comments