mocheng / react-and-redux

《深入浅出React和Redux》代码

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

第二张,子相父传递数据,prop-types 需要单独下载包和引入。

fanmucc opened this issue · comments

第二张,子相父传递数据,prop-types 需要单独下载包和引入。

具体操作步骤:

  1. 安装node,运行node -vnpm -v,检查自己的npm和node是否安装成功。
  2. import React, { Component, PropTypes } from 'react';修改成
import React, { Component } from 'react';
import PropTypes from 'prop-types';
  1. 命令行控制台切换到项目目录运行以下命令:
    npm install --save prop-types
  2. 刷新下

能不能把错字改下,好难受啊