|
1 | 1 | # Create-React-App
|
2 | 2 |
|
3 |
| -The [create-react-app](https://github.com/facebook/create-react-app) allows you to build a React website with just one line of code. |
| 3 | +Setting up a react app can be overwhelming when doing it the first time. There's tons of setup to do before actually coding in React. The good thing about the maintainers of React, **Facebook**, is that they developed a boilerplate app that can get us to start with React without the painful setup. |
| 4 | + |
| 5 | +>The [create-react-app](https://github.com/facebook/create-react-app) allows you to build a React website with just one line of code. |
4 | 6 |
|
5 | 7 | ## Build your portfolio with create-react-app
|
6 | 8 |
|
@@ -43,22 +45,22 @@ We now have our React website! Run it on your localhost:
|
43 | 45 | 
|
44 | 46 |
|
45 | 47 | ## What does each generated file do?
|
46 |
| -| File | Description | |
47 |
| -| ------------ | ------------------------------------------- | |
48 |
| -| node_modules | where dependencies are installed | |
49 |
| -| package.json | where dependencies and scripts are declared | |
50 |
| -| public | where the `index.html` is placed | |
51 |
| -| src | where the development files are | |
| 48 | +| File | Description | |
| 49 | +| ------------ | -------------------------------------------------------------------- | |
| 50 | +| node_modules | where dependencies are installed | |
| 51 | +| package.json | where dependencies and scripts are declared | |
| 52 | +| public | where the `index.html` is placed | |
| 53 | +| src | where the development files are, contains the components of your app | |
52 | 54 |
|
53 | 55 | ## Going through the flow of the project files
|
54 | 56 | The browser starts with the index.html file and reads the root div. The root div is the starting component. All component are rendered within the root div.
|
55 | 57 |
|
56 |
| -`index.html` at about line 30 |
| 58 | +`public/index.html` at about line 30 |
57 | 59 | ```html
|
58 | 60 | <div id="root"></div>
|
59 | 61 | ```
|
60 | 62 |
|
61 |
| -`index.js` at about line 7 states that the component **_App_** should be rendered within the root component. |
| 63 | +`src/index.js` at about line 7 states that the component **_App_** should be rendered within the root component. |
62 | 64 | ```javascript
|
63 | 65 | ReactDOM.render(<App />, document.getElementById("root"));
|
64 | 66 | ```
|
@@ -93,7 +95,7 @@ ReactDOM.render(<App />, document.getElementById("root"));
|
93 | 95 |
|
94 | 96 | export default App
|
95 | 97 | ```
|
96 |
| -Preview your changes in the browser. Run `yarn start`. |
| 98 | +Preview your changes in the browser. Run `yarn start`. React reloads the browser when you make edits, you don't have to restart the service everytime. |
97 | 99 |
|
98 | 100 | The browser should display the header, `Hello Women Who Code Manila!`.
|
99 |
| -Play around the App and Profile components and design the landing page for your portfolio. |
| 101 | +> Activity: Play around the App and Profile components and design the landing page for your portfolio. |
0 commit comments