Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3. Reactブートキャンプ defaultProps #1

Open
spring-raining opened this issue Aug 31, 2016 · 1 comment
Open

3. Reactブートキャンプ defaultProps #1

spring-raining opened this issue Aug 31, 2016 · 1 comment
Labels

Comments

@spring-raining
Copy link
Member

書籍版初版 p.18

上から2つ目のスニペットで、defaultPropsと定義すべきところがpropTypesとなっています。

class Pokemon extends Component {
  static propTypes = {
    name: 'Pikachu',
    level: 5,
    type: ['Electric'],
  };
}

class Pokemon extends Component {
  static defaultProps = {
    name: 'Pikachu',
    level: 5,
    type: ['Electric'],
  };
}
@spring-raining
Copy link
Member Author

Boothで頒布中の電子版(pdf)もまだ未修正です。こちらは後ほど修正して差し替えます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant