Skip to content

Commit 193b52c

Browse files
authored
Merge pull request #2 from reactjsacademy/feature/update-books
Update books
2 parents 58239e3 + 3d31bd1 commit 193b52c

48 files changed

Lines changed: 19679 additions & 163 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"bracketSpacing": true,
6+
"jsxBracketSameLine": false,
7+
"parser": "babel",
8+
"semi": false
9+
}

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"recommendations": [
3+
"formulahendry.auto-close-tag",
4+
"formulahendry.auto-rename-tag",
5+
"mgmcdermott.vscode-language-babel",
6+
"editorconfig.editorconfig",
7+
"esbenp.prettier-vscode",
8+
"jpoissonnier.vscode-styled-components"
9+
]
10+
}

README.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,76 @@
33
The goal of this exercise is to learn how to think in React.
44

55
## Prerequisites
6+
67
You need to be comfortable writing JavaScript and HTML to do this exercise. The exercise uses the following ES6 & ES5 features:
8+
79
- Module system ([import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)/ [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export))
810
- [Class syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) (extends, constructor)
911
- [Arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)
1012
- [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
1113

12-
You need to have `node`and `npm`installed in your computer.
14+
You need to have `node` and `npm` installed on your computer.
1315

1416
### If you find this exercise too difficult
1517

16-
If you find the exercise too difficult we recommend you to do the following basic React course from [freeCodeCamp](
17-
https://learn.freecodecamp.org/front-end-libraries/react/) before.
18+
If you find the exercise too difficult we recommend you to do the following basic React course from [freeCodeCamp](https://learn.freecodecamp.org/front-end-libraries/react/) before.
1819

19-
## Getting started:
20+
## Getting started
2021

21-
`git clone git@github.com:leanjscom/thinking-in-react.git && cd thinking-in-react && npm install && npm start`
22+
```console
23+
git clone git@github.com:reactjsacademy/thinking-in-react.git
24+
cd thinking-in-react
25+
npm install
26+
npm start
27+
```
2228

2329
## Exercise
2430

25-
Before you start, there are two types of components [Functional Components and Class Components](https://reactjs.org/docs/components-and-props.html#function-and-class-components). Try to use a Functional component if the component doesn't have state, you'll need to refactor code a few times during the next exercise :)
26-
27-
### Tasks
31+
Before you start, there are two types of components [Functional Components and Class Components](https://reactjs.org/docs/components-and-props.html#function-and-class-components).
2832

29-
1- Refactor the “about” and “footer” sections by creating a functional component for each. Make sure everything works.
33+
```javascript
34+
function Welcome(props) {
35+
return <h1>Hello, {props.name}</h1>;
36+
}
37+
```
3038

39+
```javascript
40+
class Welcome extends React.Component {
41+
render() {
42+
return <h1>Hello, {this.props.name}</h1>;
43+
}
44+
}
45+
```
3146

32-
2- Refactor the navbar by creating a Functional Component (AKA stateless components) and pass the dependencies (this.toggleMenu in this case) via props. Make sure everything works by clicking on the "Training" button at the top right of the screen.
47+
Try to use a Functional component if the component doesn't have state, you'll need to refactor code a few times during the next exercise 😁
3348

49+
### Tasks
3450

35-
3- Refactor the books section by creating a functional component and pass the dependencies via props. Make sure everything works.
36-
51+
- [ ] 1. Refactor the “about” and “footer” sections by creating a functional component for each.
52+
Make sure everything works.
3753

38-
4- Is there any state in app that should be in the Books component? Refactor &lt;Books&gt; books if appropriate. Should &lt;Books&gt; be a Functional Component or a Class Component now?
54+
- [ ] 2. Refactor the navbar by creating a Functional Component (AKA stateless components).
55+
Pass the dependencies (`this.toggleMenu` in this case) via props.
56+
Make sure everything works by clicking on the "Training" button at the top right of the screen.
3957

58+
- [ ] 3. Refactor the books section by creating a functional component and pass the dependencies via props.
59+
Make sure everything works.
4060

41-
5- Break &lt;Books&gt; down into &lt;BookList&gt; and &lt;BookFilter&gt;
61+
- [ ] 4. Is there any state in app that should be in the Books component?
62+
Refactor `<Books>` if appropriate. Should `<Books>` be a Functional Component or a Class Component now?
4263

64+
- [ ] 5. Break `<Books>` down into `<BookList>` and `<BookFilter>`
4365

44-
6- What do you think it would make sense to componentize next? Are there any parts on that view that you can reuse? Try to explain to a mentor what you want to refactor before you code :)
66+
- [ ] 6. What do you think it would make sense to componentize next?
67+
Are there any parts on that view that you can reuse? Try to explain to a mentor what you want to refactor before you code 😁
4568

4669
## Articles and links
4770

48-
* [https://reactjs.academy/blog/introduction-to-thinking-in-react/](https://reactjs.academy/blog/introduction-to-thinking-in-react/)
49-
* Basic React course from [freeCodeCamp](
50-
https://learn.freecodecamp.org/front-end-libraries/react/)
51-
* [https://reactjs.org/docs/introducing-jsx.html](https://reactjs.org/docs/introducing-jsx.html)
52-
* [https://reactjs.org/docs/thinking-in-react.html](https://reactjs.org/docs/thinking-in-react.html)
53-
* [babel repl example](https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=MYewdgzgLgBAEgUwDZJAYRAWwA7gWWAXhgAoBKGQgPlICgYYAeAEwEsA3K-hpgCwEYqiFCACEjAPQCuPJtioB1ZKEwIYUEEwCGMXgCcEAM0IAiXlCjYIALgkSDW4FABWEAHSOtzBJgCeJqgAlBEcoACkAZTcAQWAvH19JLSpJeW5JNk5aMgBuWloWDhhgJC0ICAA5LVVTUAItVjAEPQD0zOLS8qqakz0QAHdW2QBvYVQMHDwCAF90iUyuDI4qIA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=false&presets=es2015%2Creact%2Cstage-2&prettier=false&targets=&version=6.26.0&envVersion=)
71+
72+
- [Introduction to Thinking in React](https://reactjs.academy/blog/introduction-to-thinking-in-react/)
73+
- [A Beginner’s Guide to React](https://medium.com/leanjs/introduction-to-react-3000e9cbcd26)
74+
- [Introduction to JSX](https://reactjs.org/docs/introducing-jsx.html)
75+
- Basic React course from [freeCodeCamp](https://learn.freecodecamp.org/front-end-libraries/react/)
5476

5577
## License
5678

0 commit comments

Comments
 (0)