FrontendMasters / react-enlightenment

A thoughtful and complete introduction to React.
https://www.reactenlightenment.com
429 stars 79 forks source link

getInitialState and getDefaultProps listed as Objects, first table in 6.2 #21

Closed jim80 closed 8 years ago

jim80 commented 8 years ago

Apologies if this is a little pedantic, but the first table in 6.2 lists getInitialState and getDefaultProps thus :

getInitialState Object containing initial value of this.state getDefaultProps Object containing values to be set on this.props

To my reading the table suggests that they are objects, rather than functions that return objects.

It's quite clear on further reading that they are functions (as indeed their name would suggest), but possibly if you were very new to react and reading this book it might prove slightly confusing?

It's just a small thing, and quite possibly subject to my own interpretation of how it reads, but maybe you might want to have a quick look at it?

codylindley commented 8 years ago

Oh, yes. That isn't clear at all. Fixing. Thanks. Also adding () to functions.