5 ms·
The example in the article was lifted from the front page of the official React website [0]. [0] https://facebook.github.io/react/ https://facebook.github.io/r
by autoreleasepool 9y ago
The example in the article was lifted from the front page of the official React website [0].
[0] https://facebook.github.io/react/ https://facebook.github.io/react/
- haukur 9y agoIt wasn't lifted from the docs. The tutorial is a tic-tac-toe game, while the example in the post is an AddTodo function [edit: there appears to be an add todo section, but the code is completely different]. Furthermore, all the examples in the tutorials show a pattern where you reference functions instead of writing them inside JSX.
- autoreleasepool 9y agoCheck again. On the homepage scroll down to: > An Application " Using props and state, we can put together a small Todo application. This example uses state to track the current list of items as well as the text that the user has entered. Although event handlers appear to be rendered inline, they will be collected and implemented using event delegation. "
- haukur 9y agoFair enough - it's a todo app. The code isn't structured in the same manner as the author's, however, so my point stands. It doesn't look like the code was lifted from the docs, as you said, but instead transformed to look like spaghetti.