-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: use createRoot() React 18 uses createRoot() now instead of ReactDOM.render(). I make the replace- ment to fix the error. * perf: use system fonts before load This fixes the Lighthouse error "Ensure text remains visible during webfont load". If the font hasn't loaded yet, you might get invisible text. `font-display: swap` fixes this by using the system font until the correct one has loaded. It also improves website load.
- Loading branch information
Showing
5 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
.sidebar-content { | ||
font-weight: 900; | ||
font-family: "Roboto Mono", monospace; | ||
font-display: swap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
// The webpack.resolve.alias setting in webpack.config.js aliases '@' to 'client/src', so that all | ||
// the import paths can start from there, instead of being relative to the current file. | ||
import App from '@/components/App/App'; | ||
|
||
ReactDOM.render(<App />, document.querySelector('.root')); | ||
const root = createRoot(document.querySelector('.root')); | ||
root.render(<App />); |