├── .eslintcache ├── .gitignore ├── README.md ├── netlify.toml ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── src ├── App.css ├── App.js ├── App.test.js ├── Button.js ├── index.css ├── index.js ├── logo.svg ├── reportWebVitals.js └── setupTests.js └── yarn.lock /.eslintcache: -------------------------------------------------------------------------------- 1 | [{"/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/reportWebVitals.js":"1","/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/App.js":"2","/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/Button.js":"3"},{"size":362,"mtime":1610477152928,"results":"4","hashOfConfig":"5"},{"size":695,"mtime":1610480527146,"results":"6","hashOfConfig":"5"},{"size":299,"mtime":1610480463730,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"wl2c2p",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/reportWebVitals.js",[],"/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/App.js",[],"/Users/jlengstorf/github/learnwithjason/lets-learn-react/src/Button.js",[]] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | # Local Netlify folder 26 | .netlify -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Learn With Jason 4 | 5 |

6 |

7 | Let's Learn React! (with Ali Spittel) 8 |

9 |

10 | This app was built live on Learn With Jason and it was super fun and I’m sad you weren’t there. 11 |

12 |

13 | But don’t worry! You can still: 14 | watch the video · 15 | see the demo · 16 | deploy this project · 17 | see upcoming episodes 18 |

19 | 20 |   21 | 22 | React is everywhere: it’s used in single-person side projects and Fortune 50 apps. In this episode, Ali Spittel will introduce us to one of the leading JavaScript frameworks out there! 23 | 24 |   25 | 26 | ## More Information 27 | 28 | - [Watch this app get built live + see links and additional resources][episode] 29 | - [Follow _Learn With Jason_ on Twitch][twitch] to watch future episodes live 30 | - [Add the _Learn With Jason_ schedule to your Google Calendar][cal] 31 | 32 |   33 |

34 | 35 | Deploy this project to Netlify 36 | 37 |

38 | 39 | [episode]: https://www.learnwithjason.dev/let-s-learn-react 40 | [twitch]: https://jason.af/twitch 41 | [cal]: https://jason.af/lwj/cal 42 | 43 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 44 | 45 | ## Available Scripts 46 | 47 | In the project directory, you can run: 48 | 49 | ### `yarn start` 50 | 51 | Runs the app in the development mode.\ 52 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 53 | 54 | The page will reload if you make edits.\ 55 | You will also see any lint errors in the console. 56 | 57 | ### `yarn test` 58 | 59 | Launches the test runner in the interactive watch mode.\ 60 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 61 | 62 | ### `yarn build` 63 | 64 | Builds the app for production to the `build` folder.\ 65 | It correctly bundles React in production mode and optimizes the build for the best performance. 66 | 67 | The build is minified and the filenames include the hashes.\ 68 | Your app is ready to be deployed! 69 | 70 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 71 | 72 | ### `yarn eject` 73 | 74 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 75 | 76 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 77 | 78 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 79 | 80 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 81 | 82 | ## Learn More 83 | 84 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 85 | 86 | To learn React, check out the [React documentation](https://reactjs.org/). 87 | 88 | ### Code Splitting 89 | 90 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 91 | 92 | ### Analyzing the Bundle Size 93 | 94 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 95 | 96 | ### Making a Progressive Web App 97 | 98 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 99 | 100 | ### Advanced Configuration 101 | 102 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 103 | 104 | ### Deployment 105 | 106 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 107 | 108 | ### `yarn build` fails to minify 109 | 110 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 111 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "build" 3 | command = "npm run build" 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lets-learn-react", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.4", 7 | "@testing-library/react": "^11.1.0", 8 | "@testing-library/user-event": "^12.1.10", 9 | "react": "^17.0.1", 10 | "react-dom": "^17.0.1", 11 | "react-scripts": "4.0.1", 12 | "web-vitals": "^0.2.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 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/learnwithjason/lets-learn-react/b085f23e78da7607f728ff5f8f4941ac3538e615/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/learnwithjason/lets-learn-react/b085f23e78da7607f728ff5f8f4941ac3538e615/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/learnwithjason/lets-learn-react/b085f23e78da7607f728ff5f8f4941ac3538e615/public/logo512.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | align-items: center; 3 | background: white; 4 | display: grid; 5 | height: 100vh; 6 | text-align: center; 7 | width: 100vw; 8 | } 9 | 10 | .App-logo { 11 | height: 40vmin; 12 | pointer-events: none; 13 | } 14 | 15 | button { 16 | border: 1px solid black; 17 | border-radius: 0.25rem; 18 | font-size: 1.5rem; 19 | font-weight: bold; 20 | margin: 0.5rem; 21 | } 22 | 23 | .red { 24 | background: red; 25 | color: white; 26 | } 27 | 28 | .blue { 29 | background: blue; 30 | color: white; 31 | } 32 | .purple { 33 | background: rebeccapurple; 34 | color: white; 35 | } 36 | 37 | .yellow { 38 | background: yellow; 39 | } 40 | 41 | @media (prefers-reduced-motion: no-preference) { 42 | .App-logo { 43 | animation: App-logo-spin infinite 20s linear; 44 | } 45 | } 46 | 47 | .App-header { 48 | background-color: #282c34; 49 | min-height: 100vh; 50 | display: flex; 51 | flex-direction: column; 52 | align-items: center; 53 | justify-content: center; 54 | font-size: calc(10px + 2vmin); 55 | color: white; 56 | } 57 | 58 | .App-link { 59 | color: #61dafb; 60 | } 61 | 62 | @keyframes App-logo-spin { 63 | from { 64 | transform: rotate(0deg); 65 | } 66 | to { 67 | transform: rotate(360deg); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import './App.css'; 3 | import Button from './Button.js'; 4 | 5 | function App() { 6 | const [color, setColor] = useState('blue'); 7 | 8 | return ( 9 |
15 |
16 |

Hello world!

17 |
24 |
25 | ); 26 | } 27 | 28 | export default App; 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/Button.js: -------------------------------------------------------------------------------- 1 | function Button({ color, setColor }) { 2 | return ( 3 | 15 | ); 16 | } 17 | 18 | export default Button; 19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------