Skip to content

Commit 2ab500a

Browse files
committed
cleaning docs
1 parent 7f1a76b commit 2ab500a

File tree

8 files changed

+27
-24
lines changed

8 files changed

+27
-24
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You should check Playground Project located in the `/playground` folder. It is a
4141
- [Extras](#extras)
4242
- [tsconfig.json](#tsconfigjson)
4343
- [tslint.json](#tslintjson)
44-
- [jest.config.json](#jestconfigjson)
44+
- [jest.config.json](#jestconfigjson)
4545
- [Default and Named Module Exports](#default-and-named-module-exports)
4646
- [Vendor Types Augmentation](#vendor-types-augmentation)
4747
- [Npm Scripts](#npm-scripts)
@@ -76,7 +76,7 @@ npm i -D @types/react @types/react-dom @types/react-redux
7676

7777
# React Types Cheatsheet
7878

79-
#### `React.StatelessComponent<P>` or alias `React.SFC<P>`
79+
#### `React.StatelessComponent<P>` or alias `React.SFC<P>`
8080
Stateless functional components
8181
```tsx
8282
const MyComponent: React.SFC<MyComponentProps> = ...
@@ -114,7 +114,7 @@ const elementOnly: JSX.Element = <div /> || <MyComponent />;
114114
[⇧ back to top](#table-of-contents)
115115
116116
#### `React.CSSProperties`
117-
Type-safety for styles using css-in-js
117+
Type-safety for styles using css-in-js
118118
```tsx
119119
const styles: React.CSSProperties = { flexDirection: 'row', ...
120120
```
@@ -507,7 +507,7 @@ export default (() => (
507507
508508
## Redux Connected Components
509509
510-
### Caveat with `bindActionCreators`
510+
### Caveat with `bindActionCreators`
511511
**If you try to use `connect` or `bindActionCreators` explicitly and want to type your component callback props as `() => void` this will raise compiler errors. I happens because `bindActionCreators` typings will not map the return type of action creators to `void`, due to a current TypeScript limitations.**
512512
513513
A decent alternative I can recommend is to use `() => any` type, it will work just fine in all possible scenarios and should not cause any typing problems whatsoever. All the code examples in the Guide with `connect` are also using this pattern.
@@ -913,7 +913,7 @@ export const epics = combineEpics(addTodoToast);
913913
914914
---
915915
916-
## Selectors
916+
## Selectors
917917
918918
### "reselect"
919919
@@ -1107,7 +1107,7 @@ export const actions = {
11071107
"esSpecCompliant": true
11081108
}],
11091109
"triple-equals": [true, "allow-null-check"],
1110-
"type-literal-delimiter": true,
1110+
"type-literal-delimiter": true,
11111111
"typedef": [true,"parameter", "property-declaration"],
11121112
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"],
11131113
// tslint-react
@@ -1180,7 +1180,7 @@ import Select from '@src/components/select';
11801180
### Vendor Types Augmentation
11811181
> Strategies to fix issues coming from broken "vendor type declarations" files (*.d.ts)
11821182
1183-
#### Augmenting library internal type declarations - using relative import resolution
1183+
#### Augmenting library internal type declarations - using relative import resolution
11841184
```ts
11851185
// added missing autoFocus Prop on Input component in "antd@2.10.0" npm package
11861186
declare module '../node_modules/antd/lib/input/Input' {
@@ -1194,7 +1194,7 @@ declare module '../node_modules/antd/lib/input/Input' {
11941194
11951195
#### Augmenting library public type declarations - using node module import resolution
11961196
```ts
1197-
// fixed broken public type declaration in "rxjs@5.4.1" npm package
1197+
// fixed broken public type declaration in "rxjs@5.4.1" npm package
11981198
import { Operator } from 'rxjs/Operator';
11991199
import { Observable } from 'rxjs/Observable';
12001200

@@ -1274,7 +1274,7 @@ class StatefulCounterWithInitialCount extends React.Component<Props, State> {
12741274
class StatefulCounter extends React.Component<Props, State> {
12751275
// handlers using Class Fields with arrow functions
12761276
handleIncrement = () => {
1277-
this.setState({ count: this.state.count + 1 });
1277+
this.setState({ count: this.state.count + 1 });
12781278
};
12791279
...
12801280
}
@@ -1286,7 +1286,7 @@ class StatefulCounter extends React.Component<Props, State> {
12861286
12871287
# Roadmap
12881288
- extend HOC section with more advanced examples [#5](../../issues/5)
1289-
- investigate typing patterns for generic component children [#7](../../issues/7)
1289+
- investigate typing patterns for generic component children [#7](../../issues/7)
12901290
12911291
[⇧ back to top](#table-of-contents)
12921292
@@ -1302,10 +1302,10 @@ yarn run lint
13021302

13031303
# run type-checking in playground
13041304
yarn run tsc
1305-
1305+
13061306
# re-generate `README.md` from repo root
13071307
sh ./generate.sh
1308-
# or
1308+
# or
13091309
node ./generator/bin/generate-readme.js
13101310
```
13111311

docs/markdown/1_react.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# React Types Cheatsheet
22

3-
#### `React.StatelessComponent<P>` or alias `React.SFC<P>`
3+
#### `React.StatelessComponent<P>` or alias `React.SFC<P>`
44
Stateless functional components
55
```tsx
66
const MyComponent: React.SFC<MyComponentProps> = ...
@@ -38,7 +38,7 @@ const elementOnly: JSX.Element = <div /> || <MyComponent />;
3838
[⇧ back to top](#table-of-contents)
3939
4040
#### `React.CSSProperties`
41-
Type-safety for styles using css-in-js
41+
Type-safety for styles using css-in-js
4242
```tsx
4343
const styles: React.CSSProperties = { flexDirection: 'row', ...
4444
```
@@ -134,7 +134,7 @@ Adds error handling using componentDidCatch to any component
134134
135135
## Redux Connected Components
136136
137-
### Caveat with `bindActionCreators`
137+
### Caveat with `bindActionCreators`
138138
**If you try to use `connect` or `bindActionCreators` explicitly and want to type your component callback props as `() => void` this will raise compiler errors. I happens because `bindActionCreators` typings will not map the return type of action creators to `void`, due to a current TypeScript limitations.**
139139
140140
A decent alternative I can recommend is to use `() => any` type, it will work just fine in all possible scenarios and should not cause any typing problems whatsoever. All the code examples in the Guide with `connect` are also using this pattern.

docs/markdown/2_redux.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ When creating the store, use rootReducer. This will set-up a **strongly typed St
118118

119119
---
120120

121-
## Selectors
121+
## Selectors
122122

123123
### "reselect"
124124

docs/markdown/4_extras.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"esSpecCompliant": true
106106
}],
107107
"triple-equals": [true, "allow-null-check"],
108-
"type-literal-delimiter": true,
108+
"type-literal-delimiter": true,
109109
"typedef": [true,"parameter", "property-declaration"],
110110
"variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case", "allow-leading-underscore"],
111111
// tslint-react
@@ -178,7 +178,7 @@ import Select from '@src/components/select';
178178
### Vendor Types Augmentation
179179
> Strategies to fix issues coming from broken "vendor type declarations" files (*.d.ts)
180180
181-
#### Augmenting library internal type declarations - using relative import resolution
181+
#### Augmenting library internal type declarations - using relative import resolution
182182
```ts
183183
// added missing autoFocus Prop on Input component in "antd@2.10.0" npm package
184184
declare module '../node_modules/antd/lib/input/Input' {
@@ -192,7 +192,7 @@ declare module '../node_modules/antd/lib/input/Input' {
192192
193193
#### Augmenting library public type declarations - using node module import resolution
194194
```ts
195-
// fixed broken public type declaration in "rxjs@5.4.1" npm package
195+
// fixed broken public type declaration in "rxjs@5.4.1" npm package
196196
import { Operator } from 'rxjs/Operator';
197197
import { Observable } from 'rxjs/Observable';
198198

docs/markdown/5_faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class StatefulCounterWithInitialCount extends React.Component<Props, State> {
3737
class StatefulCounter extends React.Component<Props, State> {
3838
// handlers using Class Fields with arrow functions
3939
handleIncrement = () => {
40-
this.setState({ count: this.state.count + 1 });
40+
this.setState({ count: this.state.count + 1 });
4141
};
4242
...
4343
}

docs/markdown/6_end.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roadmap
22
- extend HOC section with more advanced examples [#5](../../issues/5)
3-
- investigate typing patterns for generic component children [#7](../../issues/7)
3+
- investigate typing patterns for generic component children [#7](../../issues/7)
44

55
[⇧ back to top](#table-of-contents)
66

@@ -16,10 +16,10 @@ yarn run lint
1616

1717
# run type-checking in playground
1818
yarn run tsc
19-
19+
2020
# re-generate `README.md` from repo root
2121
sh ./generate.sh
22-
# or
22+
# or
2323
node ./generator/bin/generate-readme.js
2424
```
2525

docs/markdown/_intro.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# React & Redux in TypeScript - Static Typing Guide
2+
23
**_"This guide is about to teach you how to leverage [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html), [Generics](https://www.typescriptlang.org/docs/handbook/generics.html) and other [Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html) as much as possible to write the minimal amount of type annotations needed for your JavaScript code to be completely Type Safe"_** - this will make sure you get all the benefits of Static Typing and your productivity won't be slowed down by adding excess type annotations.
34

5+
[![Join the chat at https://gitter.im/react-redux-typescript-guide/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/react-redux-typescript-guide/Lobby)
6+
47
> #### _Found it usefull? Want more updates?_ [**Give it a :star2:**](https://github.com/piotrwitek/react-redux-typescript-patterns/stargazers)
58
69
### Goals

docs/markdown/_toc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- [Extras](#extras)
2121
- [tsconfig.json](#tsconfigjson)
2222
- [tslint.json](#tslintjson)
23-
- [jest.config.json](#jestconfigjson)
23+
- [jest.config.json](#jestconfigjson)
2424
- [Default and Named Module Exports](#default-and-named-module-exports)
2525
- [Vendor Types Augmentation](#vendor-types-augmentation)
2626
- [Npm Scripts](#npm-scripts)

0 commit comments

Comments
 (0)