Resources for understanding Javascript used for Redux and Thunk? - reactjs

I am doing a tutorial on React with Redux and Thunk and am having trouble understanding how some of the props are being sent to the different components. I think I understanding how the Flux Architecture in general is working, but the code itself filled with functions returning other functions and other syntax that is making my head spin. How the dispatcher is working for example is a complete mystery to me. Googling around I have read that this is a very "functional programming" approach to doing things in react. Can anyone point me to some resources to get up to speed with the type of Javascript used for Redux and Thunk?
Thanks!

Here are some links,
Redux.org
React-redux tutorial for beginners
Redux-thunk

Related

I want to use redux saga instead of redux thunk. Will this cause any problems in future in my application?

I'm usually used to React Saga so I want to use Redux Tool Kit and Saga. Butt is confused about whether this will be a problem later.
Redux-saga works perfectly fine with Redux Toolkit.
Keep in mind though that Redux Saga is only useful in very complicated scenarios and almost no apps are complicated enough to really warrant it's use. That's why the official Redux Style guide recommends to use Thunks for async logic until you come to a point where it is not sufficient any more.
You can also easily combine thunks and saga in the same app, using the more simple thunks per default and only using sagas where you really need them, keeping the mental load down.
There is no problem if you configure it correctly, I have used it in more than 3 large projects with the complex flow but didn't have a problem in the saga

migrating from useContext + useReducer to Redux

I have learned about how to use Redux as the state management library, but most of my project is using react useContext + useReducer since it's not a huge project.
And as far as I know, the Redux is similar to react useReducer which is only managing the state. But I want to create a dedicated file where I can put all the functions as useContext does.
Is it possible to use useContext + Redux? or is there any better solution for it?
Thanks in advance, appreciate any kinda response.
Neither useContext nor Redux tell you anything about how to structure your files. Theoretically you could put everything into one file or split it up into hundreds.
There are recommended project structures though.
Take a look at the Style Guide, which gives an example of a recommended file/folder structure.
Also, stay away from most external tutorials that still show switch..case reducers, connect or folder structures with separate action, reducer and constant files. Those are heavily outdated. Follow the official tutorial instead:
https://redux.js.org/tutorials/essentials/part-1-overview-concepts

Any new solution to replace redux in reactjs?

I am new with react js.
I made two components to send/receive data using props between them.
But it gets more complex, I feel like I need to replace them with other solution like redux. I wonder there is the latest better solution to replace redux now for communication between two react components.
There was a lot of opinions between redux and context api like this post. But today, I can say yes, you can replace redux with just react itself. Because, currently react provides so much concepts just like the redux, context api. You can find react additional hooks like useReducer, useCallback, useMemo, etc.
But arguably, redux is still worth for maintaining project easily. You can have redux devtool, keep the code clean (state in store - a separate place for concerns).
There are more concerns over this. You may see this issue what future react will have. You may also find the medium blog helpful and the reddit discussion.
Worth Reading:
State management with react hooks and context api
Redux main task is to be a 'predictable state container', and, as you wrote, it also makes sharing data between components much easier. The main drawback is that it requires additional code, but I think that it is worth it.
For apps / websites that are not very small, I wouldn't use react / react native without it.
The way redux works may be a bit difficult to understand in the beginning. The following is a great article that helped me when I started using it: redux connect explained

Who is using React + mobx + react-router-v4?

I'am new to React and during my "self-learning" process I discovered Redux. Nice! Then, React-router-v4. Nice too!!
Then, I discovered how to mix redux and react-router-v4, a little bit tricky, but it works.
Last week, I also discovered mobx and I love it. I like its simplicity compared to redux. But I wonder if somebody is using it with react-router-v4 because I did not find much tutorials on the web that talk about this mix of technologies.
Any feedback or advice?
Thank you guys!

React Rxjs with Falcor or Relay

I have been playing with ReactiveX for a bit and really like the approach. I have also been following Relay and Falcor for a while and understand the advantages of declarative data fetching.
I have seen people integrating react, redux with falcor, but have not seen any attempts to integrate React, Rxjs with either Relay or Falcor.
So I wanted to write a simple todo example, but before that wanted to ask whether it is a sound combination at all. Are there compatible and whether some advantages of one approach will negatively affect advantages of others.
Also if anyone can share some resources on this topic please do :)
There are several libraries that I found:
https://github.com/trxcllnt/reaxtor no React js though
https://github.com/FourSS/refar
UPDATE: there is an attempt by meteor developers to create their own version of relay using reactive graphql see Apollo Project They use observables for watch queries
Also there is a good library called relate which you can integrate with rxjs redux style state machine

Resources