Closed zanona closed 3 years ago
@sentry/browser
@sentry/node
raven-js
raven-node
"@sentry/react": "^6.1.0"
https://codesandbox.io/s/sentry-show-dialog-user-d1lgw?file=/src/index.js
Whenever using the property showDialog on <Sentry.ErrorBoundary>, even though the user has been set previously, the dialog won't infer those settings and autofill the name and email fields on the widget form.
showDialog
<Sentry.ErrorBoundary>
import React, { useEffect, useState } from "react"; import ReactDOM from "react-dom"; import * as Sentry from "@sentry/react"; Sentry.init({ dsn: process.env.SENTRY_DSN //ADD YOURS }); function App() { const [foo, setFoo] = useState("ahoy"); useEffect(() => { Sentry.setUser({ email: "foo@bar.com", name: "Foobar" }); }, []); return ( <Sentry.ErrorBoundary showDialog fallback={<h1>Error</h1>}> <h1>Hello {foo}</h1> <button onClick={() => setFoo({ foo: true })}>Break the world</button> </Sentry.ErrorBoundary> ); } const rootElement = document.getElementById("root"); ReactDOM.render(<App />, rootElement);
This is fixed by https://github.com/getsentry/sentry-javascript/pull/3792.
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
https://codesandbox.io/s/sentry-show-dialog-user-d1lgw?file=/src/index.js
Whenever using the property
showDialog
on<Sentry.ErrorBoundary>
, even though the user has been set previously, the dialog won't infer those settings and autofill the name and email fields on the widget form.