reduxjs / redux

A JS library for predictable global state management
https://redux.js.org
MIT License
60.88k stars 15.27k forks source link

Real world example does not work on master #2469

Closed headquarters closed 7 years ago

headquarters commented 7 years ago
  1. Clone the repo on the master branch
  2. cd redux/examples/real-world
  3. npm install
  4. npm start

The real world example fails with the following errors:

./src/containers/App.js
  Line 9:   'propTypes' is not defined           no-undef
  Line 18:  'handleDismissClick' is not defined  no-undef
  Line 23:  'handleChange' is not defined        no-undef

If I pin all the dependencies to the exact version in examples/real-world/package.json, do another npm install, and try again I get similar errors but only reported for UserPage.js.

So this appears to be an issue with the class properties transform not working properly, but I couldn't pinpoint the exact cause. If I figure out a solution I'll put up a PR.

markerikson commented 7 years ago

Those do not appear to be "real" errors, but rather ESLint warnings that are being marked as errors. I think CRA may have somewhat recently decided to enforce some ESLint rules as errors.

Not sure on the right way to take care of this.

headquarters commented 7 years ago

Ok, that makes a lot more sense considering everything is actually defined that is reported. When linter errors take over the screen and don't let you actually see the app, though, I still consider them "real". 😄

How about a PR to disable those with / eslint / rules in those files?

headquarters commented 7 years ago

Some extra information: the example works if you do NOT do yarn or npm install at the top level of the redux repo.

So, if you only install the modules in examples/real-world, it works. If you go up to the root redux folder, install the modules, then go back and reinstall in real-world and re-run the example app then these errors show up.

markerikson commented 7 years ago

Huh. That's... interesting. Some side effect of ESLint config resolution, I guess?

bbwstar commented 7 years ago

Hi Mark

How are you doing?

I am Sasha and beginner for learning react-redux

I would like to learn about react and react-redux

Please give me good advice

Looking forward to hearing with you

Thanks, Sasha

On Sat, Jun 24, 2017 at 5:04 AM, Mark Erikson notifications@github.com wrote:

Huh. That's... interesting. Some side effect of ESLint config resolution, I guess?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/reactjs/redux/issues/2469#issuecomment-310772519, or mute the thread https://github.com/notifications/unsubscribe-auth/AY3p3JCncZyMEa2araM0moW9G0sMfzYZks5sHChcgaJpZM4OEBaX .

markerikson commented 7 years ago

@bbwstar : This is an issue tracker, not a help forum.

That said, I keep a big list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem, as well as a solid source of good info on more advanced topics. You should also check out the Reactiflux chat channels on Discord, at https://www.reactiflux.com .