sentry icon indicating copy to clipboard operation
sentry copied to clipboard

[Onboarding/React] Make snippet copy/pasteable and change to something that compiles

Open shellmayr opened this issue 1 year ago • 0 comments

The current code snippet in the react onboarding prevents the code from compiling because it points to a non-existent method - the user never even gets to the point where the code gets executed, hence there it does not produce a Sentry issue: return <button onClick={() => methodDoesNotExist()}>Break the world</button>;

This alternative worked for me:

function MyButton() {
  return <button onClick={() => {throw new Error("This is your first error!");}}>Break the world</button>;
}

shellmayr avatar Oct 18 '24 08:10 shellmayr