Skip to content
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

Use React legacy API to fix react-helmet #109

Merged
merged 2 commits into from
Jun 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect } from 'react';
import { createRoot } from 'react-dom/client';
import { render } from 'react-dom';

// Root component.
function Root() {
Expand All @@ -13,6 +13,6 @@ function Root() {
return <p>Hello from Starter</p>;
}

const container = document.getElementById('app-container');
const root = createRoot(container);
root.render(<Root />);
// project-seed does not use the latest React API introduced in version 18
// as commonly used modules might be incompatible with it (e.g. react-helmet v6.1.0).
render(<Root />, document.querySelector('#app-container'));