Skip to content

Commit 7a11b58

Browse files
committed
review suggestions
1 parent 0ea255d commit 7a11b58

File tree

6 files changed

+34
-8
lines changed

6 files changed

+34
-8
lines changed

docs/platforms/javascript/common/user-feedback/configuration/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ You can use your own button instead of the default injected button to trigger th
219219

220220
```javascript
221221
const feedback = feedbackIntegration({
222-
// Disable injecting the default widget
222+
// Disable the injection of the default widget
223223
autoInject: false,
224224
});
225225

@@ -230,7 +230,7 @@ feedback.attachTo(document.querySelector("#your-button"), {
230230
```typescript {tabTitle: NextJs}
231231
function AttachToFeedbackButton() {
232232
const [feedback, setFeedback] = useState();
233-
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
233+
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
234234
useEffect(() => {
235235
setFeedback(Sentry.getFeedback());
236236
}, []);
@@ -256,7 +256,7 @@ Alternatively, you can call `feedback.createForm()` and have full control over w
256256

257257
```javascript
258258
const feedback = feedbackIntegration({
259-
// Disable injecting the default widget
259+
// Disable the injection of the default widget
260260
autoInject: false,
261261
});
262262

@@ -267,7 +267,7 @@ form.open();
267267
```typescript {tabTitle: NextJS}
268268
function CreateFeedbackFromButton() {
269269
const [feedback, setFeedback] = useState();
270-
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
270+
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
271271
useEffect(() => {
272272
setFeedback(Sentry.getFeedback());
273273
}, []);

docs/platforms/javascript/common/user-feedback/v7/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ You can use your own button instead of the default injected button to trigger th
169169

170170
```javascript
171171
const feedback = feedbackIntegration({
172-
// Disable injecting the default widget
172+
// Disable the injection of the default widget
173173
autoInject: false,
174174
});
175175

platform-includes/user-feedback/manual-injection/javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
```javascript
22
const feedback = feedbackIntegration({
3-
// Disable injecting the default widget
3+
// Disable the injection of the default widget
44
autoInject: false,
55
});
66

platform-includes/user-feedback/manual-injection/javascript.nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```jsx {tabTitle: NextJS}
22
function ToggleFeedbackButton() {
33
const [feedback, setFeedback] = useState();
4-
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
4+
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
55
useEffect(() => {
66
setFeedback(Sentry.getFeedback());
77
}, []);

platform-includes/user-feedback/manual-injection/javascript.react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```jsx {tabTitle: React}
22
function ToggleFeedbackButton() {
33
const [feedback, setFeedback] = useState();
4-
// Read `getFeedback` on the client only, to avoid hydration errors when server rendering
4+
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
55
useEffect(() => {
66
setFeedback(Sentry.getFeedback());
77
}, []);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
```jsx {tabTitle: Remix}
2+
function ToggleFeedbackButton() {
3+
const [feedback, setFeedback] = useState();
4+
// Read `getFeedback` on the client only, to avoid hydration errors during server rendering
5+
useEffect(() => {
6+
setFeedback(Sentry.getFeedback());
7+
}, []);
8+
9+
const [widget, setWidget] = useState();
10+
return (
11+
<button
12+
type="button"
13+
onClick={async () => {
14+
if (widget) {
15+
widget.removeFromDom();
16+
setWidget(null);
17+
} else {
18+
setWidget(feedback.createWidget());
19+
}
20+
}}
21+
>
22+
{widget ? "Remove Widget" : "Create Widget"}
23+
</button>
24+
);
25+
}
26+
```

0 commit comments

Comments
 (0)