Skip to content

Commit 277f1e4

Browse files
authored
Merge branch 'master' into master
2 parents a95187c + acbd5a4 commit 277f1e4

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

pages/Interfaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ interface SquareConfig {
8686
function createSquare(config: SquareConfig): { color: string; area: number } {
8787
let newSquare = {color: "white", area: 100};
8888
if (config.color) {
89-
// Error: Property 'color' does not exist on type 'SquareConfig'
90-
newSquare.color = config.color;
89+
// Error: Property 'clor' does not exist on type 'SquareConfig'
90+
newSquare.color = config.clor;
9191
}
9292
if (config.width) {
9393
newSquare.area = config.width * config.width;

pages/tutorials/Migrating from JavaScript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function myCoolFunction() {
279279
}
280280

281281
myCoolFunction(function(x) { console.log(x) }, [1, 2, 3, 4]);
282-
myCoolFunction(function(x) { console.log(x) }, 1, 2, 3, 4]);
282+
myCoolFunction(function(x) { console.log(x) }, 1, 2, 3, 4);
283283
```
284284

285285
In this case, we need to use TypeScript to tell any of our callers about the ways `myCoolFunction` can be called using function overloads.
@@ -388,7 +388,7 @@ For instance, imagine a `Point` class, and imagine a function that we wish to ad
388388
```ts
389389
class Point {
390390
constuctor(public x, public y) {}
391-
getDistance(point: Point) {
391+
getDistance(p: Point) {
392392
let dx = p.x - this.x;
393393
let dy = p.y - this.y;
394394
return Math.sqrt(dx ** 2 + dy ** 2);

pages/tutorials/React & Webpack.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ import * as React from "react";
120120

121121
export interface HelloProps { compiler: string; framework: string; }
122122

123-
export const Hello = (props: HelloProps) => <h1>Hello from {this.props.compiler} and {this.props.framework}!</h1>;
124-
123+
export const Hello = (props: HelloProps) => <h1>Hello from {props.compiler} and {props.framework}!</h1>;
125124
```
126125

127126
Note that while this example uses [stateless functional components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions)), we could also make our example a little *classier* as well.

0 commit comments

Comments
 (0)