You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-sdk/README.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,15 @@ function StartHuddleButton() {
106
106
<>
107
107
<buttononClick={track}>Start huddle!</button>
108
108
<button
109
-
onClick={() =>requestFeedback({ title: "How do you like Huddles?" })}
109
+
onClick={(e) =>
110
+
requestFeedback({
111
+
title: "How do you like Huddles?",
112
+
position: {
113
+
type: "POPOVER",
114
+
anchor: e.currentTargetasHTMLElement,
115
+
},
116
+
})
117
+
}
110
118
>
111
119
Give feedback!
112
120
</button>
@@ -139,15 +147,28 @@ function StartHuddle() {
139
147
`useRequestFeedback()` returns a function that lets you open up a dialog to ask for feedback on a specific feature.
140
148
See [Automated Feedback Surveys](https://docs.bucket.co/product-handbook/live-satisfaction) for how to do this automatically, without code.
141
149
142
-
```ts
150
+
When using the `useRequestFeedback` you must pass the feature key to `requestFeedback`.
151
+
The example below shows how to use `position` to ensure the popover appears next to the "Give feedback!" button.
152
+
153
+
```tsx
143
154
import {useTrackEvent} from "@bucketco/react-sdk";
144
155
145
156
const requestFeedback = useRequestFeedback();
146
157
147
-
requestFeedback({
148
-
featureId: "bucket-feature-id",
149
-
title: "How satisfied are you with file uploads?",
150
-
});
158
+
<button
159
+
onClick={(e) =>
160
+
requestFeedback({
161
+
featureKey: "huddle-feature-key",
162
+
title: "How satisfied are you with file uploads?",
163
+
position: {
164
+
type: "POPOVER",
165
+
anchor: e.currentTargetasHTMLElement,
166
+
},
167
+
})
168
+
}
169
+
>
170
+
Give feedback!
171
+
</button>;
151
172
```
152
173
153
174
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/browser-sdk/FEEDBACK.md#manual-feedback-collection for more information on `requestFeedback`
0 commit comments