Skip to content

Update React examples to React 18 #6542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AbhiPrasad opened this issue Mar 27, 2023 · 1 comment · Fixed by #6568
Closed

Update React examples to React 18 #6542

AbhiPrasad opened this issue Mar 27, 2023 · 1 comment · Fixed by #6568
Assignees

Comments

@AbhiPrasad
Copy link
Member

Core or SDK?

Platform/SDK

Which part? Which one?

@sentry/react

Description

@AbhiPrasad since React 18, there's a updated method of importing react.

I took this from the official react website

import { createRoot } from 'react-dom/client';

// Clear the existing HTML content
document.body.innerHTML = '<div id="app"></div>';

// Render your React component instead
const root = createRoot(document.getElementById('app'));
root.render(<h1>Hello, world</h1>);

Originally posted by @Jesse-Box in #6508 (comment)

Suggested Solution

Change everywhere we need to change

@Jesse-Box
Copy link
Contributor

This would be a matter of changing the doc's as the wizard has already made this change.

@AbhiPrasad AbhiPrasad self-assigned this Mar 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants