├── .devcontainer
└── devcontainer.json
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ └── main.yml
├── .gitignore
├── .vscode
└── settings.json
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
└── exercise-files
├── 02-ReactAPI
├── 02_01_useState
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ └── List.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── List.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
├── 02_02_useEffect
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ └── List.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── List.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
└── 02_03_useReducer
│ ├── 02_03_1
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ └── List.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── List.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
│ ├── 02_03_2
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ └── Result.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── Result.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
│ └── 02_03_3
│ ├── final
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── Result.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
│ └── starter
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── components
│ ├── Form.js
│ └── Result.js
│ ├── index.css
│ ├── index.js
│ └── store.js
├── 03-contextAPI
├── 03_03
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ ├── Result.js
│ │ │ └── Score.js
│ │ │ ├── context.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ ├── Result.js
│ │ └── Score.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
├── 03_04
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── components
│ │ │ ├── Form.js
│ │ │ ├── Result.js
│ │ │ └── Score.js
│ │ │ ├── context.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ └── store.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ ├── Result.js
│ │ └── Score.js
│ │ ├── context.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
├── 03_05
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── components
│ │ ├── Form.js
│ │ ├── Result.js
│ │ └── Score.js
│ │ ├── context.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
└── 03_06
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── components
│ ├── Form.js
│ ├── Result.js
│ └── Score.js
│ ├── context.js
│ ├── index.css
│ ├── index.js
│ └── store.js
├── 04-recoil
├── 04_01
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── App.test.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ ├── logo.svg
│ │ │ ├── reportWebVitals.js
│ │ │ └── setupTests.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
├── 04_02
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── App.test.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ ├── logo.svg
│ │ │ ├── reportWebVitals.js
│ │ │ └── setupTests.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
├── 04_03
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── App.test.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ ├── logo.svg
│ │ │ ├── reportWebVitals.js
│ │ │ └── setupTests.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
├── 04_04
│ ├── final
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── App.test.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ ├── logo.svg
│ │ │ ├── reportWebVitals.js
│ │ │ └── setupTests.js
│ └── starter
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
├── 04_05
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── common
│ │ ├── atoms.js
│ │ ├── selectors.js
│ │ └── styles.js
│ │ ├── components
│ │ ├── Form.js
│ │ └── List.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
└── 04_06
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── common
│ ├── atoms.js
│ ├── selectors.js
│ └── styles.js
│ ├── components
│ ├── Form.js
│ └── List.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ └── setupTests.js
└── 05_Zustand
├── 05_02
├── final
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
└── starter
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── index.css
│ ├── index.js
│ └── store.js
├── 05_03
├── final
│ ├── README.md
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── index.css
│ │ ├── index.js
│ │ └── store.js
└── starter
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── index.css
│ ├── index.js
│ └── store.js
├── 05_04
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
└── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ └── setupTests.js
├── 05_05
├── final
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ ├── setupTests.js
│ │ └── store.js
└── starter
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ └── setupTests.js
└── 05_06
├── final
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
└── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ ├── setupTests.js
│ └── store.js
└── starter
├── README.md
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
└── src
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
├── reportWebVitals.js
├── setupTests.js
└── store.js
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": [
3 | "GitHub.github-vscode-theme"
4 | // Additional Extensions Here
5 | ],
6 | "onCreateCommand" : "echo PS1='\"$ \"' >> ~/.bashrc", //Set Terminal Prompt to $
7 | }
8 |
9 | // DevContainer Reference: https://code.visualstudio.com/docs/remote/devcontainerjson-reference
10 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Codeowners for these exercise files:
2 | # * (asterisk) deotes "all files and folders"
3 | # Example: * @producer @instructor
4 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Copy To Branches
2 | on:
3 | workflow_dispatch:
4 | jobs:
5 | copy-to-branches:
6 | runs-on: ubuntu-latest
7 | steps:
8 | - uses: actions/checkout@v2
9 | with:
10 | fetch-depth: 0
11 | - name: Copy To Branches Action
12 | uses: planetoftheweb/copy-to-branches@v1.2
13 | env:
14 | key: main
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | .tmp
4 | npm-debug.log
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 | Contribution Agreement
3 | ======================
4 |
5 | This repository does not accept pull requests (PRs). All pull requests will be closed.
6 |
7 | However, if any contributions (through pull requests, issues, feedback or otherwise) are provided, as a contributor, you represent that the code you submit is your original work or that of your employer (in which case you represent you have the right to bind your employer). By submitting code (or otherwise providing feedback), you (and, if applicable, your employer) are licensing the submitted code (and/or feedback) to LinkedIn and the open source community subject to the BSD 2-Clause license.
8 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_01_useState/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_01_useState/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_02_useEffect/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_1/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_2/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/02-ReactAPI/02_03_useReducer/02_03_3/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/components/Score.js:
--------------------------------------------------------------------------------
1 | function Score({ count }) {
2 | return (
3 |
6 | );
7 | }
8 | export default Score;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/context.js:
--------------------------------------------------------------------------------
1 | import { createContext } from "react";
2 |
3 | const Context = createContext();
4 |
5 | const Provider = ({ children }) => {
6 | return {children};
7 | };
8 | export default Provider;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import Provider from "./context";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_03/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/src/components/Score.js:
--------------------------------------------------------------------------------
1 | function Score({ count }) {
2 | return (
3 |
6 | );
7 | }
8 | export default Score;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import "./index.css";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_03/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/src/components/Score.js:
--------------------------------------------------------------------------------
1 | function Score({ count }) {
2 | return (
3 |
6 | );
7 | }
8 | export default Score;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import Provider from "./context";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_04/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/components/Score.js:
--------------------------------------------------------------------------------
1 | function Score({ count }) {
2 | return (
3 |
6 | );
7 | }
8 | export default Score;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/context.js:
--------------------------------------------------------------------------------
1 | import { createContext } from "react";
2 |
3 | const Context = createContext();
4 |
5 | const Provider = ({ children }) => {
6 | return {children};
7 | };
8 | export default Provider;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import Provider from "./context";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_04/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_05/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_05/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_05/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | function Result({ result, input }) {
4 | const [message, setMessage] = useState("");
5 |
6 | useEffect(() => {
7 | const answer = result === parseInt(input);
8 | setMessage(answer ? "You guessed right!" : "Try Again :(");
9 | if (!result) {
10 | setMessage("");
11 | }
12 | }, [result, input]);
13 |
14 | return (
15 |
23 | );
24 | }
25 | export default Result;
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/src/components/Score.js:
--------------------------------------------------------------------------------
1 | function Score({ count }) {
2 | return (
3 |
6 | );
7 | }
8 | export default Score;
9 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import Provider from "./context";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_05/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_06/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_06/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/03-contextAPI/03_06/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/src/components/Result.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect, useContext } from "react";
2 | import { Context } from "../context";
3 |
4 | function Result() {
5 | const [color, setColor] = useState("");
6 | const [message, setMessage] = useState("");
7 | const value = useContext(Context);
8 | const [state] = value;
9 |
10 | useEffect(() => {
11 | const answer = state.result === parseInt(state.input);
12 | setColor(answer ? "text-success" : "text-danger");
13 | setMessage(answer ? "You guessed right!" : "Try Again :(");
14 | if (!state.result) {
15 | setMessage("");
16 | }
17 | }, [state.result, state.input]);
18 |
19 | return (
20 |
28 | );
29 | }
30 | export default Result;
31 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/src/components/Score.js:
--------------------------------------------------------------------------------
1 | import { useContext } from "react";
2 | import { Context } from "../context";
3 |
4 | function Score() {
5 | const value = useContext(Context);
6 | const [state] = value;
7 | return (
8 |
11 | );
12 | }
13 | export default Score;
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import Provider from "./context";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 |
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/exercise-files/03-contextAPI/03_06/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 | import { devtools } from 'zustand/middleware'
3 |
4 | const useCounter = create(devtools((set, get) => ({
5 | count: 0,
6 | increment: () => {
7 | set(() => ({
8 | count: get().count + 1
9 | }))
10 | },
11 | decrement: () => {
12 | if (get().count < 1) { return false }
13 | set(() => ({
14 | count: get().count - 1
15 | }))
16 | },
17 | incrementBy10: () => {
18 | set(() => ({
19 | count: get().count + 10
20 | }))
21 | },
22 | decrementBy10: () => {
23 | set(() => ({
24 | count: get().count - 10 > 0 ? get().count - 10 : 0
25 | }))
26 | },
27 | reset: () =>
28 | set(() => ({
29 | count: 0
30 | }))
31 | })), { name: "counter"});
32 |
33 | export default useCounter;
34 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import React from "react";
3 | import { RecoilRoot } from "recoil";
4 | import ReactDOM from "react-dom/client";
5 | import "./index.css";
6 | import App from "./App";
7 |
8 | const root = ReactDOM.createRoot(document.getElementById("root"));
9 | root.render(
10 |
11 |
12 |
13 |
14 |
15 | );
16 |
17 | x;
18 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test",
18 | "eject": "react-scripts eject"
19 | },
20 | "eslintConfig": {
21 | "extends": [
22 | "react-app",
23 | "react-app/jest"
24 | ]
25 | },
26 | "browserslist": {
27 | "production": [
28 | ">0.2%",
29 | "not dead",
30 | "not op_mini all"
31 | ],
32 | "development": [
33 | "last 1 chrome version",
34 | "last 1 firefox version",
35 | "last 1 safari version"
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_01/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import "./index.css";
4 | import App from "./App";
5 |
6 | const root = ReactDOM.createRoot(document.getElementById("root"));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_01/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_02/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
16 | x;
17 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_02/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_03/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_03/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_04/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_04/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_05/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_05/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_05/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/App.js:
--------------------------------------------------------------------------------
1 | import Form from "./components/Form";
2 | import List from "./components/List";
3 | import styles from "./common/styles";
4 | import "./App.css";
5 |
6 | function App() {
7 | return (
8 |
9 |
10 |
11 |
12 | );
13 | }
14 | export default App;
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/common/atoms.js:
--------------------------------------------------------------------------------
1 | import { atom } from "recoil";
2 |
3 | const items = [
4 | { id: 1, task: "pay bills", done: false },
5 | { id: 2, task: "buy groceries", done: false },
6 | { id: 3, task: "learn Redux", done: false },
7 | ];
8 |
9 | export const listState = atom({
10 | key: "listState",
11 | default: items,
12 | });
13 |
14 | export const allState = atom({
15 | key: "allState", // unique ID (with respect to other atoms/selectors)
16 | default: items, // default value (aka initial value)
17 | });
18 |
19 | export const filterState = atom({
20 | key: "filterState",
21 | default: false,
22 | });
23 |
24 | export const inputValue = atom({
25 | key: "inputValue",
26 | default: false,
27 | });
28 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/common/selectors.js:
--------------------------------------------------------------------------------
1 | import { selector } from "recoil";
2 | import { listState, filterState, allState } from "./atoms";
3 |
4 | export const listItems = selector({
5 | key: "listItems",
6 | get: ({ get }) => {
7 | const all = get(allState);
8 | const isFiltered = get(filterState); // you can replace 'bool' with 'isFiltered'
9 | if (isFiltered) {
10 | return all.filter((item) => item.done);
11 | }
12 | return all;
13 | },
14 | });
15 | export const itemsCount = selector({
16 | key: "itemsCount", // unique ID (with respect to other atoms/selectors)
17 | get: ({ get }) => {
18 | const list = get(listState);
19 | return list.some((item) => !!item.done);
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/common/styles.js:
--------------------------------------------------------------------------------
1 | const styles = {
2 | container: { width: "40%" },
3 | item_done: {
4 | textDecoration: "line-through",
5 | color: "gray",
6 | fontStyle: "italic",
7 | },
8 | };
9 | export default styles;
10 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/components/List.js:
--------------------------------------------------------------------------------
1 | import { useRecoilValue } from "recoil";
2 | import { listItems } from "../common/selectors";
3 |
4 | import styles from "../common/styles";
5 | const [list, setList] = useRecoilState(listState);
6 | const [all, setAll] = useRecoilState(allState);
7 |
8 | const List = ({ allItems, check }) => {
9 | const allItems = useRecoilValue(listItems);
10 | const check = (id) => {
11 | const updated = all.map((item) => {
12 | return item.id === id ? { ...item, done: !item.done } : item;
13 | });
14 | setList(updated);
15 | setAll(updated);
16 | };
17 | return (
18 |
19 | {allItems.map((item) => (
20 | - check(item.id)}
23 | >
24 | {item.task}
25 |
26 | ))}
27 |
28 | );
29 | };
30 | export default List;
31 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_05/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "recoil": "^0.7.7",
13 | "web-vitals": "^2.1.4"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_06/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_06/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/04-recoil/04_06/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/common/atoms.js:
--------------------------------------------------------------------------------
1 | import { atom } from "recoil";
2 |
3 | const items = [
4 | { id: 1, task: "pay bills", done: false },
5 | { id: 2, task: "buy groceries", done: false },
6 | { id: 3, task: "learn Redux", done: false },
7 | ];
8 |
9 | export const listState = atom({
10 | key: "listState",
11 | default: items,
12 | });
13 |
14 | export const allState = atom({
15 | key: "allState", // unique ID (with respect to other atoms/selectors)
16 | default: items, // default value (aka initial value)
17 | });
18 |
19 | export const filterState = atom({
20 | key: "filterState",
21 | default: false,
22 | });
23 |
24 | export const inputValue = atom({
25 | key: "inputValue",
26 | default: false,
27 | });
28 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/common/selectors.js:
--------------------------------------------------------------------------------
1 | import { selector } from "recoil";
2 | import { listState, filterState, allState } from "./atoms";
3 |
4 | export const listItems = selector({
5 | key: "listItems",
6 | get: ({ get }) => {
7 | const all = get(allState);
8 | const isFiltered = get(filterState); // you can replace 'bool' with 'isFiltered'
9 | if (isFiltered) {
10 | return all.filter((item) => item.done);
11 | }
12 | return all;
13 | },
14 | });
15 | export const itemsCount = selector({
16 | key: "itemsCount", // unique ID (with respect to other atoms/selectors)
17 | get: ({ get }) => {
18 | const list = get(listState);
19 | return list.some((item) => !!item.done);
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/common/styles.js:
--------------------------------------------------------------------------------
1 | export default {
2 | container: { width: "40%" },
3 | item_done: {
4 | textDecoration: "line-through",
5 | color: "gray",
6 | fontStyle: "italic",
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/components/List.js:
--------------------------------------------------------------------------------
1 | import styles from "../common/styles";
2 | const List = ({ allItems, check }) => {
3 | return (
4 |
5 | {allItems.map((item) => (
6 | - check(item.id)}
9 | >
10 | {item.task}
11 |
12 | ))}
13 |
14 | );
15 | };
16 | export default List;
17 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { RecoilRoot } from "recoil";
3 | import ReactDOM from "react-dom/client";
4 | import "./index.css";
5 | import App from "./App";
6 |
7 | const root = ReactDOM.createRoot(document.getElementById("root"));
8 | root.render(
9 |
10 |
11 |
12 |
13 |
14 | );
15 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/04-recoil/04_06/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | const useCounter = create((set, get) => ({
4 | count: 0,
5 | increment: () => {
6 | set(() => ({
7 | count: get().count + 1,
8 | }));
9 | },
10 | decrement: () => {
11 | set(() => ({
12 | count: get().count - 1,
13 | }));
14 | },
15 | reset: () =>
16 | set(() => ({
17 | count: 0,
18 | })),
19 | }));
20 |
21 | export default useCounter;
22 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.2"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_02/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_02/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | const useCounter = create((set, get) => ({
4 | count: 0,
5 | increment: () => {
6 | set(() => ({
7 | count: get().input ? get().count + get().input : get().count + 1,
8 | }));
9 | },
10 | decrement: () => {
11 | if (get().count < 1) {
12 | return false;
13 | }
14 | set(() => ({
15 | count: get().count - 1,
16 | }));
17 | },
18 | reset: () =>
19 | set(() => ({
20 | count: 0,
21 | })),
22 | }));
23 |
24 | export default useCounter;
25 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/final/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | const useCounter = create((set, get) => ({
4 | count: 0,
5 | increment: () => {
6 | set(() => ({
7 | count: get().count + 1,
8 | }));
9 | },
10 | decrement: () => {
11 | set(() => ({
12 | count: get().count - 1,
13 | }));
14 | },
15 | reset: () =>
16 | set(() => ({
17 | count: 0,
18 | })),
19 | }));
20 |
21 | export default useCounter;
22 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_03/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_03/starter/src/store.js:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | const useCounter = create((set, get) => ({
4 | count: 0,
5 | increment: () => {
6 | set(() => ({
7 | count: get().count + 1,
8 | }));
9 | },
10 | decrement: () => {
11 | set(() => ({
12 | count: get().count - 1,
13 | }));
14 | },
15 | reset: () =>
16 | set(() => ({
17 | count: 0,
18 | })),
19 | }));
20 |
21 | export default useCounter;
22 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4"
13 | },
14 | "scripts": {
15 | "start": "react-scripts start",
16 | "build": "react-scripts build",
17 | "test": "react-scripts test",
18 | "eject": "react-scripts eject"
19 | },
20 | "eslintConfig": {
21 | "extends": [
22 | "react-app",
23 | "react-app/jest"
24 | ]
25 | },
26 | "browserslist": {
27 | "production": [
28 | ">0.2%",
29 | "not dead",
30 | "not op_mini all"
31 | ],
32 | "development": [
33 | "last 1 chrome version",
34 | "last 1 firefox version",
35 | "last 1 safari version"
36 | ]
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_04/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_04/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_04/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_04/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_05/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_05/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/final/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/final/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/final/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/final/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checklist",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@testing-library/jest-dom": "^5.16.5",
7 | "@testing-library/react": "^13.4.0",
8 | "@testing-library/user-event": "^13.5.0",
9 | "react": "^18.2.0",
10 | "react-dom": "^18.2.0",
11 | "react-scripts": "5.0.1",
12 | "web-vitals": "^2.1.4",
13 | "zustand": "^4.3.9"
14 | },
15 | "scripts": {
16 | "start": "react-scripts start",
17 | "build": "react-scripts build",
18 | "test": "react-scripts test",
19 | "eject": "react-scripts eject"
20 | },
21 | "eslintConfig": {
22 | "extends": [
23 | "react-app",
24 | "react-app/jest"
25 | ]
26 | },
27 | "browserslist": {
28 | "production": [
29 | ">0.2%",
30 | "not dead",
31 | "not op_mini all"
32 | ],
33 | "development": [
34 | "last 1 chrome version",
35 | "last 1 firefox version",
36 | "last 1 safari version"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/starter/public/favicon.ico
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/starter/public/logo192.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LinkedInLearning/react-state-management-4411320/4c54ae4e4cb7539a335f449568a0e4ecaf70f7ba/exercise-files/05_Zustand/05_06/starter/public/logo512.png
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/exercise-files/05_Zustand/05_06/starter/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------