Skip to content

Commit

Permalink
Update explanations for main.jsx boilerplate code
Browse files Browse the repository at this point in the history
Removed mentions of importing React and ReactDOM directly.
  • Loading branch information
Legalunicorn committed Aug 24, 2024
1 parent 47a3302 commit 8f5ea0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions react/introduction/setting_up_a_react_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ createRoot(document.getElementById("root")).render(

Whoa! There's quite a lot here. You are not expected to recognize much of this (if any) right now. Here's a brief rundown of what is happening:

1. We import `React` itself and its fellow `ReactDOM` package.
1. We import `StrictMode` and `createRoot` from the `react` and `react-dom` packages respectively.
1. We import the `App` component from `App.jsx`, so that we may place (render) it within the DOM.
1. We import some CSS styling (you may recognize this syntax from the Webpack material).
1. We create a `root` object by invoking `ReactDOM.createRoot` with an element from our `index.html`.
1. We create a `root` object by invoking `createRoot` with an element from our `index.html`.
1. We invoke the `render` method which is attached to our `root` object, with some very interesting-looking syntax inside the parentheses.

All of this may understandably look unlike anything you've seen up until now, but have no fear, once you've spent the time with this course, you'll know exactly what all of this does, and *much more*.
Expand Down

0 comments on commit 8f5ea0d

Please sign in to comment.