Giter VIP home page Giter VIP logo

tyroprogrammer / learn-react-app Goto Github PK

View Code? Open in Web Editor NEW
3.6K 54.0 321.0 15.45 MB

Application that will help you learn React fundamentals. Install this application locally - there's tutorial, code snippets and exercises. The main objective of this project is to help you get off the ground with React!

License: MIT License

HTML 1.56% JavaScript 81.24% CSS 1.08% TypeScript 16.12%
react reactjs react-fundamentals learn learn-react learn-reactjs javascript guided-exercises tutorial tutorial-exercises

learn-react-app's Introduction

Welcome to Learn React App!

MIT License Last commit

Github Contributors Watch on GitHub Star on GitHub


The goal of this tutorial is to quickly get you off the ground with React concepts. This tutorial has hands-on exercises which I consider to be the most important part of this tutorial.

The way this tutorial works is that first, you have to checkout this project on your computer, and run the application locally. Then open the application on a browser and you can go through the tutorial as you like.

Learn React App

Checkout

Checkout the project to your computer using git:

git clone https://github.com/tyroprogrammer/learn-react-app.git

Environment Setup

You can either use npm or yarn to run this application. Please pick one and follow below instructions.

If you want to use yarn and don't have yarn installed on your local machine please execute below command to install yarn:

npm install -g yarn

Installing Dependencies

On the root directory of the project please execute either one of the below commands to install all the project dependencies. You don't have to run both commands, just pick one.

yarn install

OR

npm install

Starting application

On the root directory of the project please execute either one of the below commands to start the tutorial application:

yarn start

OR

npm start

After this is complete, the application will be deployed on port 3000. Open a browser and navigate to localhost:3000.


Online Tutorial

You can also run this tutorial in Gitpod, a free online dev environment for GitHub:

Open in Gitpod


Following the tutorial

Tutorials on this application are fairly straightforward to follow. Each tutorial has one or more exercises. You'll see once you are in the tutorial.

The exercise panel has split view. The left-hand side of the screen has your solution rendered and the right-hand side of the screen has the target solution. Right above the exercise panel, you'll see the location of exercise files.

Please open the exercise file on your favorite editor (VS Code, Atom, Sublime, IntelliJ etc.) and start making changes by following the instructions. Exercise files are heavily commented. Read through the comments and you should be able to write up the solution. If you have any confusion you can refer to the solution file for that exercise. Every time you make changes to the exercise file and save it, the browser will reload automatically reflecting your changes.

Exercise Comment Guide

Most comments in the exercise files start with one of the below signs. This is to help you understand what you should do to the code immediately following these comments.

🏆 - Trophy - Describes the overall goal of the exercise. You can find this at the top of the exercise file.

💡 - Light Bulb - General information regarding the code immediately following this comment. You might find it throughout the code. No action is required on your part, just read them.

✏️ - Pencil - You are supposed to edit the code immediately following this comment. It is followed by a description of the change that you need to do.

🧭 - Compass - When the description of change is not enough, the compass will give you more direction. You will find it alongside the pencil when more elaborate instruction is deemed necessary.

🚨 - Alarm - This means danger. Read the comment carefully. Usually, it's used to say you shouldn't change the code immediately following this. It will create havoc.

FAQ

Do I need to install `yarn` or can I use `npm`?

You don't really need yarn. Just use npm if you like.

Which browser should I use?

This tutorial has been tested in Chrome only so I highly recommend you use Chrome.

Which code editor should I use for exercise?

Anything really (Sublime, Atom, VS Code, IntelliJ) - its your preference.

I accidentally deleted something in an exercise that I shouldn't have. What should I do?

The easiest way is to just revert back to the previous version on your editor. If you want to start anew, then just checkout that particular file from GitHub again using something like:

git checkout HEAD --  exercise/01-helloWorld.js

Contribution

If you went through the exercise and saw some inconsistencies or if you have an idea to make the overall tutorial better please feel free to open a PR.

learn-react-app's People

Contributors

0xflotus avatar aatishb avatar acidicx avatar aude avatar codito avatar dependabot[bot] avatar djoume avatar dominikherold avatar franckl avatar iamnotaturtle avatar jankeromnes avatar karlhorky avatar karlwills avatar llk23r avatar nathanlschneider avatar nirmalkumarv avatar nminchow avatar onlywade avatar ryannielson avatar shearichard avatar sijoma avatar snyk-bot avatar tavito avatar thelimeburner avatar tyroprogrammer avatar urnas avatar ykushch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-react-app's Issues

Build:markdown unsuccessful using 'yarn start'

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build:markdown' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild:markdown', 'build:markdown', 'postbuild:markdown' ]
5 info lifecycle [email protected]prebuild:markdown: [email protected]
6 info lifecycle [email protected]
build:markdown: [email protected]
7 verbose lifecycle [email protected]build:markdown: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build:markdown: PATH: C:\Users\simon\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\simon\Repos\learn-react-app\node_modules.bin;C:\Users\simon\Repos\learn-react-app\node_modules.bin;C:\Users\simon\AppData\Local\Yarn\Data\link\node_modules.bin;C:\Users\simon\Repos\learn-react-app\node_modules.bin;C:\Users\simon\AppData\Local\Yarn\Data\link\node_modules.bin;C:\Program Files\libexec\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\lib\node_modules\npm\bin\node-gyp-bin;C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Program Files\nodejs;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Java\jdk1.8.0_172\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Gradle\gradle-4.7\bin;C:\Program Files (x86)\Yarn\bin;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft VS Code\bin;C:\Users\simon\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\simon\AppData\Roaming\npm;C:\Users\simon\AppData\Local\Yarn\bin;C:\Program Files\heroku\bin;C:\src\flutter_windows_v1.0.0-stable\flutter\bin;
9 verbose lifecycle [email protected]build:markdown: CWD: C:\Users\simon\Repos\learn-react-app
10 silly lifecycle [email protected]
build:markdown: Args: [ '/d /s /c', 'node scripts/processMarkdown' ]
11 silly lifecycle [email protected]build:markdown: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build:markdown: Failed to exec build:markdown script
13 verbose stack Error: [email protected] build:markdown: node scripts/processMarkdown
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Users\simon\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess. (C:\Users\simon\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:920:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\simon\Repos\learn-react-app
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\simon\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build:markdown"
18 verbose node v6.11.4
19 verbose npm v6.1.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build:markdown: node scripts/processMarkdown
22 error Exit status 1
23 error Failed at the [email protected] build:markdown script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

exercise/06-LifecycleMethod DataApi doesn't work

First off, thanks for this tutorial, it's very nice!

I noticed in doing exercise/06-LifecycleMethod that the data is not loading.

Proxy error: Could not proxy request /api/company/profile/AMZN from 172.17.0.3:3000 to https://financialmodelingprep.com.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
Proxy error: Could not proxy request /api/company/profile/AMZN from 172.17.0.3:3000 to https://financialmodelingprep.com.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (EAI_AGAIN).

I tried changing API_BASE to const API_BASE = https://financialmodelingprep.com/api/company/profile`;` but then the browser wouldn't load it due to financialmodelingprep.com

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://financialmodelingprep.com/api/company/profile/AMZN. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

I suggest simplifying the tutorial so that the data is served by the tutorial instead of going to a 3rd party resource.

Request: Connect to Live API

Can you please add an example where we connect to an actual working API? Would be great to see how to manage APIs keys, constants, etc.

Local setup issue

node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn cmd ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}

Node.js v18.13.0

Potential improvement:

In Section: Handling Events
http://localhost:3000/tutorial/handling-events

The first example creates a function that contains a button
"function ClickableButton(props){ ..."
The second example creates a function that contains an InputBox
but it still uses the name ClickableButton

Although this is not an error, using the second function name confused me since I thought the two examples were talking about the same thing until I cut and pasted them to do a quick comparison.
recommended solution: Changing the second name to function "ChangeableInput" would reduce the confusion.

BTW: excellent tutorial. thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.