
React in Patterns - nikhildaga
https://krasimir.gitbooks.io/react-in-patterns/content/
======
kuwze
There is another awesome gitbook, React in Depth[0].

[0]: [https://developmentarc.gitbooks.io/react-
indepth/content/](https://developmentarc.gitbooks.io/react-indepth/content/)

~~~
jshc
curious about the explicit true and false in one of their code examples. any
good reason for that?

// dispatching an action based on state change componentWillUpdate(nextProps,
nextState) { if (nextState.open == true && this.state.open == false) {
this.props.onWillOpen(); } }

~~~
mullsork
Do you mean instead of using !nextState.open and `this.state.open`? Reads a
little easier to write out the booleans in my opinion.

------
crispyporkbites
This is great. Everyone says react is easy and can be learnt in a day, and the
docs/tutorials definitely make it feel that way. But then when you actually go
to use it there are a bazillion funky patterns using new-ish es6 patterns and
operators, and by the time you’ve implemented them they are outdated and no
longer best practice because apparently there’s a better way now. So this list
is useful.

~~~
jjude
I equate learning any new domain as going into a zoo. You look at each animal
on its own and you can learn about difference between animals. You can
complete it reasonably in a weekend. But going into wild wild forest is
entirely another. (If you are interested, I wrote about it here:
[https://jjude.com/are-you-learning-a-new-domain-visit-its-
zo...](https://jjude.com/are-you-learning-a-new-domain-visit-its-zoo/))

I learned React reasonably quick. But when I started writing production
application, I got into so many cases which were not covered in introductory
materials. I found answers to some of these cases via google; I had to find
answers to many others by trial and error.

That is why people sharing these type of patterns helps. We all become wiser
before getting into wild forest.

