4 ms·
I am confused. In the react docs - here specifically, https://reactjs.org/docs/state-and-lifecycle.html https://reactjs.org/docs/state-and-lifecycle.html The
by yoava 6y ago
I am confused.
In the react docs - here specifically, https://reactjs.org/docs/state-and-lifecycle.html https://reactjs.org/docs/state-and-lifecycle.html
The first action item when talking about state is to concert a function to a class.
Are you saying that the official react docs, when introducing state, promote using an obsolete API?
- PKop 6y agoYes. "We recommend trying Hooks in new code" [0] "..we’d encourage you to start trying Hooks in new components you write" "In the longer term, we expect Hooks to be the primary way people write React components." You made a conscious choice to use code with "var" and class components in a side-by-side comparison of an article titled "IS Stencil Better than React" which implies right now, not "is this old example of TodoMVC better than Stencil's example". My overarching point is this choice was a bad choice, if your purpose was to inform. [0] https://reactjs.org/docs/hooks-faq.html https://reactjs.org/docs/hooks-faq.html
- yoava 6y agoConsidering that hooks are recommended in the hooks-faq, yet the React 1,2,3 Main Concepts talks OO - I find the statement that OO is obsolete. Maybe that is the intention of the React team, but it is not reflected in their main documentation yet. As for the style of the React example - I have taken the React example from todoMVC "as is". I invite you to write any other React implementation of TodoMVC, and will do my best to create the equivalent with Stencil.