Skip to content

Docs misleading on how to progress from Basics: Data Flow tutorial to Usage with React tutorial #2107

@digitalmacgyver

Description

@digitalmacgyver

Currently the Basics tutorial in the docs walks you through creating some actions, reducers, and a store for a todo app.

Then at the end of the tutorial at http://redux.js.org/docs/basics/DataFlow.html# it says:

"Now that you know how Redux works, let's connect it to a React app."

This strongly implies you will be extending the files you have developed in the Basics tutorial with React.

In fact, during the Usage With React tutorial you completely reimplement the actions and reducers, in different files, with substantially different style / syntax.

None of the files you use during the Basics tutorial should be used in the Usage with React tutorial.

Worse - if you attempt to continue to follow along you end up with a broken react/redux app that doesn't function properly because of the two implementations of the reducers and an unfortunate name collision between import files.

The Usage With React tutorial has its entry point in:

./index.js

And its reducer code in:

./reducers/index.js

And imports the todoApp into index.js with:

import todoApp from './reducers';

Which is supposed to find ./reducers/index.js

If someone has been following along in the tutorial, they will have a:

./reducers.js

file in the root directory here that also defines a todoApp, and the import line in index.js will get the version of todoApp from reducers.js, not ./reducers/index.js.

This file will have not-completely-incorrect code, things are not totally broken, rather the resulting app has some working functionality (adding todos, filtering on active filter), and some broken functionality (clicking on todos to change their active filter).

The beginner trying to follow the docs is left with the impression that they have some inscrutable error in their code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions