Open alpual opened 6 years ago
Redux shines in really complex applications with lots of components. It is hard to explain that to someone looking at the first 10 lines of code. It is like explaining taxes to 8 year old.
Also, once you start using it only then you can understand when not to use it.
It's not meant to be a tutorial for Redux, but just showing how to use Redux within this TypeScript template. I suggest you read through the tutorials on the Redux docs site.
@alpual The term 'starter' is not what you think it means. In this case, I believe this repo assumes you are already familiar with react / redux in js land, but now doing the same things in ts.
The following section may have a steep learning curve. We strongly suggest you familiarize yourself with Redux through its documentation.
Did you follow through the tutorials in the Redux doc? The example you are stuck on is pretty much the same as what's in the redux tutorial just in js.
As for your question, the code should go into src/containers/Hello.tsx
as per readme:
I really tried to make this starter/tutorial approachable for as broad an audience as possible. My approach is really
I would love to explore the ins and outs, but I think it's just out of scope for this project. Maybe we need a better explanation for the problems a state manager like Redux tackles.
My opinion is that this is a lightweight starter that expects you to have a basic understanding of each technology.
You do give warning that the learning curve is steep once you jump into redux. However, trying to follow it while modifying my own code gets me to a point where I am totally lost. This is not a starter, despite its name. You walk us through getting react set up, and it's pretty clear. Once we get to Redux, you basically introduce a bunch of code with little bits of text describing the code. The explanation is basically nonexistent, and consists almost entirely of "add this code to this file" type instruction.
I get to a point where I'm supposed to add this code, and your description doesn't seem to say where it belongs. I'd like to finish following along, but frankly, it would take me as long to track down where this code belongs as it would to finish a new tutorial.
export function mapStateToProps({ enthusiasmLevel, languageName }: StoreState) { return { enthusiasmLevel, name: languageName, } }