GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Localizes Samples & Updates JSBin Links (#16) · cpchrispack/learning-react@270bfbd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • chapter-01
    • readme.md
  • chapter-02
    • 01-declaring-variables
      • 01-const.html
      • 02-const.html
      • 03-let.html
      • 04-let.html
      • 05-let.html
      • 06-let.html
      • 07-template-strings.html
      • 08-template-strings.html
      • 09-template-strings.html
      • 10-template-strings.html
    • 02-es6-functions
      • 01-default-parameters.html
      • 02-default-parameters.html
    • 03-arrow-functions
      • 01-arrows.html
      • 02-arrows.html
      • 03-arrows.html
      • 04-arrows.html
      • 05-arrows.html
      • 06-arrows.html
      • 07-arrows.html
      • 08-arrows.html
      • 09-arrows.html
      • 10-arrows.html
      • 11-arrows.html
    • 04-objects-and-arrays
      • 01-destructuring.html
      • 02-destructuring.html
      • 03-destructuring.html
      • 04-destructuring.html
      • 05-destructuring.html
      • 06-object-literal-enhancement.html
      • 07-object-literal-enhancement.html
      • 08-object-literal-enhancement.html
      • 09-object-literal-enhancement.html
      • 10-spread-operator.html
      • 11-spread-operator.html
      • 12-spread-operator.html
      • 13-spread-operator.html
      • 14-spread-operator.html
      • 15-spread-operator.html
    • 05-promises
      • 01-promises.html
      • 02-promises.html
    • 06-es6-class-syntax
      • 01-classes.html
      • 02-classes.html
      • 03-classes.html
    • babel-inline-transpiler.html
    • readme.md
  • chapter-03
    • 01-functional-javascript
      • 01-functional.html
      • 02-functional.html
      • 03-functional.html
      • 04-functional.html
      • 05-functional.html
      • 06-functional.html
      • 07-functional.html
    • 02-imperative-vs-declarative
      • 01-imperative-declarative.html
      • 02-imperative-declarative.html
    • 03-populate-the-us
      • populate-united-states.html
      • populate-united-states.js
    • 04-immutability
      • 01-immutability.html
      • 02-immutability.html
      • 03-immutability.html
      • 04-immutability.html
      • 05-immutability.html
      • 06-immutability.html
    • 05-pure-functions
      • 01-pure-functions.html
      • 02-pure-functions.html
      • 03-pure-functions.html
      • 04-pure-functions.html
      • 05-pure-functions.html
    • 06-transforming-data
      • 01-data.html
      • 02-data.html
      • 03-data.html
      • 04-data.html
      • 05-data.html
      • 06-data.html
      • 07-data.html
      • 08-data.html
      • 09-data.html
      • 10-data.html
      • 11-data.html
      • 12-data.html
    • 07-higher-order-functions
      • 01-higher-order-fns.html
      • 02-higher-order-fns.html
    • 08-recursion
      • 01-recursion.html
      • 02-recursion.html
      • 03-recursion.html
    • 09-composition
      • 01-composition.html
      • 02-composition.html
      • 03-composition.html
      • 04-imperative-clock.html
      • 04-imperative-clock.js
      • 05-declarative-clock.html
      • 05-declarative-clock.js
    • readme.md
  • chapter-04
    • 01-page-setup
      • 01-page-setup.html
      • 02-baked-salmon.html
    • 02-react-elements
      • 01-elements.html
      • 02-elements.html
      • 03-elements.html
      • 04-elements.html
      • 05-elements.html
    • 03-react-components
      • 01-components.html
      • 02-components.html
      • 03-components.html
      • 04-components.html
    • 04-dom-rendering-moods
      • DOM-rendering-moods.css
      • DOM-rendering-moods.html
      • DOM-rendering-moods.js
    • 05-factories
      • 01-factories.html
      • 02-factories.html
      • 03-factories.html
      • 04-factories.html
    • readme.md
  • chapter-05
    • page-setup.html
    • readme.md
    • recipes.html
  • chapter-06
    • 01-property-validation-and-default-props
      • 01-incorrect-props-no-error.html
      • 02-introducing-prop-types-npm.html
      • 03-prop-types-success.html
      • 04-cryptic-problems-when-prop-missing.html
      • 05-better-errors-with-is-required.html
      • 06-successful-validation.html
      • 07-default-properties.html
      • 08-custom-validation.html
      • 09-stateless-prop-validation.html
      • 10-stateless-default-props.html
    • 02-refs
      • 01-color-component-before-refs.html
      • 02-color-component-with-refs.html
      • 03-Color-Component-binding.html
      • 04-two-way-data-todo.html
      • 05-without-default-function.html
      • 06-check-for-property.html
      • 07-default-property.html
      • 08-stateless-default-prop.html
      • 09-stateless-default-arg.html
    • 03-component-state
      • 01-the-star-component.html
      • 02-the-star-rating-component.html
      • 03-setting-state-from-props.html
      • styles.css
    • readme.md
  • chapter-07
    • 01-mounting-lifecycle
      • 01-mounting.html
      • 02-mounting.html
    • 02-updating-lifecycle
      • 01-updating.html
      • 02-updating.html
    • 03-children
      • 01-children.html
      • 02-children.html
      • 03-children.html
    • 04-library-integration
      • 01-libraries.html
      • 02-libraries.html
      • 03-libraries.html
      • 04-libraries.html
    • 05-higher-order-components
      • 01-hocs.html
      • 02-hocs.html
      • 03-hocs.html
      • 04-hocs.html
      • 05-hocs.html
    • 06-managing-state-outside-react
      • 01-state.html
    • readme.md
  • chapter-08
    • 01-reducers
      • 01-reducers.html
      • 02-reducers.html
      • 03-reducers.html
    • 02-the-store
      • 01-store.html
      • 02-store.html
      • 03-store.html
      • 04-store.html
      • 05-store.html
      • 06-store.html
      • 07-store.html
    • 03-action-creators
      • 01-action-creators.html
      • 02-action-creators.html
    • 04-middleware
      • 01-middleware.html
      • 02-middleware.html
    • readme.md

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎chapter-01/readme.md‎

Copy file name to clipboardExpand all lines: chapter-01/readme.md
+21-7Lines changed: 21 additions & 7 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ optionally install one of these version mangers:
5353

5454
Installing the React Tools
5555
--------------------------------
56-
Next, there are some Chrome developer extensions or Firefox add-ons that you will need to install in order to debug React:
56+
Next, install the React developer tools:
5757

58-
* Detector ([Chrome](https://chrome.google.com/webstore/detail/react-detector/jaaklebbenondhkanegppccanebkdjlh?hl=en-US))
5958
* Development Tools ([Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) |
6059
[Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/))
6160

@@ -64,8 +63,23 @@ Working with JSBin
6463
This repository links to samples hosted on JSBin so that you can immediately begin changing each sample and checking
6564
output to see how each sample has changed.
6665

67-
Here is a Hello World sample that JSBin has assigned the identifier __gosabo__. There are 3 available versions of this
68-
sample in JSBin under the same identifier.
66+
Here is a Hello World sample that JSBin has assigned the identifier __gosabo__. There are 3 available versions of this sample in JSBin under the same identifier.
67+
68+
Note: All JSBin links throughout this repository use React 15. To update, change the script tag CDN links to version 16.
69+
70+
Change
71+
72+
```html
73+
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
74+
<script src="https://fb.me/react-dom-15.1.0.js"></script>
75+
```
76+
77+
To
78+
79+
```html
80+
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
81+
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
82+
```
6983

7084
##### A preview of the latest version in a sample:
7185
[http://output.jsbin.com/gosabo](http://output.jsbin.com/gosabo)
@@ -89,9 +103,9 @@ CDN's for JavaScript libraries
89103
Ultimately, we will be working with webpack and npms, but to get running quickly, here are some CDN links that
90104
can be included in JSBin with this syntax: `<script src="https://[CDN LINK]"></script>`
91105

92-
* [React](https://unpkg.com/react@15.4.2/dist/react.js)
93-
* [React DOM](https://unpkg.com/react-dom@15.4.2/dist/react-dom.js)
94-
* [Babel Inline Transpiller](https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js)
106+
* [React](https://unpkg.com/react@16/umd/react.development.js)
107+
* [React DOM](https://unpkg.com/react-dom@16/umd/react-dom.development.js)
108+
* [Babel Inline Transpiler](https://unpkg.com/babel-[email protected]/babel.min.js)
95109
* [fetch](https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js)
96110
* [Redux](https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.min.js)
97111
* [React Router Source](https://cdnjs.cloudflare.com/ajax/libs/react-router/4.0.0/react-router.min.js)
Collapse file

‎chapter-02/01-declaring-variables/01-const.html‎

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Const</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Const</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
// The value of a variable can change
15+
16+
var pizza = true
17+
pizza = false
18+
console.log(pizza)
19+
20+
</script>
21+
</body>
22+
</html>
Collapse file

‎chapter-02/01-declaring-variables/02-const.html‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Const</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Const</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
// ES6 introduces constants
15+
16+
const pizza = true
17+
pizza = false
18+
19+
</script>
20+
</body>
21+
</html>
Collapse file

‎chapter-02/01-declaring-variables/03-let.html‎

Copy file name to clipboard
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Let</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Let</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
// Variables cannot be scoped to code blocks
15+
16+
var topic = "JavaScript"
17+
18+
if (topic) {
19+
var topic = "React"
20+
console.log('block', topic)
21+
}
22+
23+
console.log('global', topic)
24+
25+
</script>
26+
</body>
27+
</html>
Collapse file

‎chapter-02/01-declaring-variables/04-let.html‎

Copy file name to clipboard
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Let</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Let</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
// ES6 lexical variable scoping with let
15+
16+
var topic = "JavaScript"
17+
18+
if (topic) {
19+
let topic = "React"
20+
console.log('block', topic)
21+
}
22+
23+
console.log('global', topic)
24+
25+
</script>
26+
</body>
27+
</html>
Collapse file

‎chapter-02/01-declaring-variables/05-let.html‎

Copy file name to clipboard
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<style media="screen">
7+
#container {
8+
display: flex;
9+
justify-content: space-around;
10+
}
11+
12+
#container>div {
13+
height: 5em;
14+
width: 5em;
15+
background-color: purple;
16+
}
17+
</style>
18+
<title>Let</title>
19+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
20+
</head>
21+
<body>
22+
<h1>Click on a Box</h1>
23+
<div id="container"></div>
24+
<script type="text/babel">
25+
26+
// Problem, counters are not scoped to for loop blocks
27+
28+
var div,
29+
container = document.getElementById('container')
30+
31+
for (var i=0; i<5; i++) {
32+
div = document.createElement('div')
33+
div.onclick = function() {
34+
alert('This is box #' + i)
35+
}
36+
container.appendChild(div)
37+
}
38+
39+
</script>
40+
</body>
41+
</html>
Collapse file

‎chapter-02/01-declaring-variables/06-let.html‎

Copy file name to clipboard
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<style media="screen">
7+
#container {
8+
display: flex;
9+
justify-content: space-around;
10+
}
11+
12+
#container>div {
13+
height: 5em;
14+
width: 5em;
15+
background-color: purple;
16+
}
17+
</style>
18+
<title>Let</title>
19+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
20+
</head>
21+
<body>
22+
<h1>Click on a Box</h1>
23+
<div id="container"></div>
24+
25+
<script type="text/babel">
26+
27+
// Solution, lexical variable scope
28+
29+
var div,
30+
container = document.getElementById('container')
31+
32+
for (let i=0; i<5; i++) {
33+
div = document.createElement('div')
34+
div.onclick = function() {
35+
alert('This is box #' + i)
36+
}
37+
container.appendChild(div)
38+
}
39+
40+
</script>
41+
</body>
42+
</html>
Collapse file

‎chapter-02/01-declaring-variables/07-template-strings.html‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Template Strings</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Template Strings</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
const lastName = "Ferrell"
15+
const middleName = "William"
16+
const firstName = "John"
17+
18+
// string concatenation
19+
20+
console.log(lastName + ", " + firstName + " " + middleName)
21+
22+
</script>
23+
</body>
24+
</html>
Collapse file

‎chapter-02/01-declaring-variables/08-template-strings.html‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Template Strings</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Template Strings</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
const lastName = "Ferrell"
15+
const middleName = "William"
16+
const firstName = "John"
17+
18+
// ES6 template strings
19+
20+
console.log(`${lastName}, ${firstName} ${middleName}`)
21+
22+
</script>
23+
</body>
24+
</html>
Collapse file

‎chapter-02/01-declaring-variables/09-template-strings.html‎

Copy file name to clipboard
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
5+
<meta charset="utf-8">
6+
<title>Template Strings</title>
7+
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
8+
</head>
9+
<body>
10+
<h1>Template Strings</h1>
11+
<p>Open the console</p>
12+
<script type="text/babel">
13+
14+
var lastName = "Ferrell"
15+
var middleName = "William"
16+
var firstName = "John"
17+
18+
var ticketAgent = "The iO Theater"
19+
var event = "TJ & Dave"
20+
var qty = 2
21+
var price = 10
22+
23+
// ES6 template strings do not ignore whitespace
24+
25+
console.log(`
26+
27+
Hello ${firstName},
28+
29+
Thanks for ordering ${qty} tickets to ${event}.
30+
31+
Order Details
32+
${firstName} ${middleName} ${lastName}
33+
${qty} x $${price} = $${qty*price} to ${event}
34+
35+
You can pick your tickets up at will call 30 minutes before
36+
the show.
37+
38+
Thanks,
39+
40+
${ticketAgent}
41+
42+
`)
43+
44+
</script>
45+
</body>
46+
</html>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.