Skip to content

Commit 377d661

Browse files
Fix prop-types
1 parent ef35d85 commit 377d661

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

instructions/1-react-redux.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ Now you need to be able to get the store from inside a component instance to be
119119
to do that, `redux` provide a function called `connect` that allow you to create some sort of wrapper (Higher Order Component) that will link your wrapped component to the `redux` store available in the `react` context. For example, if you want to dispatch an action from a simple component :
120120

121121
```javascript
122-
import React, { Component, PropTypes } from 'react';
122+
import React, { Component } from 'react';
123+
import PropTypes from 'prop-types';
123124
import { connect } from 'react-redux';
124125

125126
class SimpleComponent extends Component {
@@ -145,7 +146,8 @@ When you call connect without a first parameter, the wrapped component will only
145146
However, when you use `connect()(YourComponent)`, it is not possible to access the current state of the store. If you want to do that, you'll have to pass a mapping function as the first parameter of `connect(mapStateToProps)(YourComponent)` with the following signature `(storeState: Any) => propertiesPassedToYourComponent: Object`
146147

147148
```javascript
148-
import React, { Component, PropTypes } from 'react';
149+
import React, { Component } from 'react';
150+
import PropTypes from 'prop-types';
149151
import { connect } from 'react-redux';
150152

151153
class SimpleComponent extends Component {

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"es-symbol": "1.1.2",
1111
"es6-shim": "0.35.3",
1212
"prettier": "1.7.4",
13+
"prop-types": "15.6.0",
1314
"react": "16.0.0",
1415
"react-dom": "16.0.0",
1516
"react-redux": "5.0.6",

src/components/Regions.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import * as WinesService from '../services/Wines';
34
import { Loader } from '.';
45

src/components/Wine.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { Loader } from '.';
34
import * as WinesService from '../services/Wines';
45
import { LikeButton, CommentButton, CommentList, CommentModal } from '.';

src/components/WineApp.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23

34
export class WineApp extends Component {
45
static contextTypes = {

src/components/WineList.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Component, PropTypes } from 'react';
1+
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { Loader } from '.';
34
import * as WinesService from '../services/Wines';
45

yarn.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -5082,7 +5082,7 @@ preserve@^0.2.0:
50825082
version "0.2.0"
50835083
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
50845084

5085-
prettier@^1.7.4:
5085+
50865086
version "1.7.4"
50875087
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa"
50885088

@@ -5132,7 +5132,7 @@ promise@^7.1.1:
51325132
dependencies:
51335133
asap "~2.0.3"
51345134

5135-
prop-types@^15.5.10, prop-types@^15.6.0:
5135+
prop-types@15.6.0, prop-types@^15.5.10, prop-types@^15.6.0:
51365136
version "15.6.0"
51375137
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
51385138
dependencies:

0 commit comments

Comments
 (0)