React JS / Redux Tutorial - 7 - mapStateToProps

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

6:30 made my week - seriously thought I was the only confused person until I heard you explain it.

robertkirby
Автор

THANK YOU ! By far, the most understandable explanation I've found online

brittaneyanderson
Автор

best explanation of Redux I've come across so far!!!

nikolasbogucharsky
Автор

2k20 and it's still good tut on this topic!

DIEZ
Автор

is a curried function. It takes UserList component and decorates it with props and for the values of props, it uses mapping from the mapStateToProps function.

Notice we export this newly decorated component not the component itself.

When called in connect function, mapStateToProps gets the state from Provider component. Remember we supplied store={store} prop in Provider component. store.getState() is the very same state mapStateToProps function uses.

Youtubist
Автор

watched more than 10 different tutorials having most likes on youtube but I thought Redux is not my cup of tea until I watched your series bucky.

Priyamgupta
Автор

That first sentence xD
An I'm even a freakin Kraut! Thanks for the callout xD

elCamo
Автор

superb !! very well explained in simple way. Thanks

lasanthasamarasekara
Автор

Appreciate your comment about how difficult mapStateToProps appears - this is the one part of react-redux that I'm really struggling with

mattsaunders
Автор

This is the best explanation for this topic. Thank you very much!!!!

adhipathis
Автор

hm, why do you not need to this.createListItems = ? Is this something you don't need to do when you don't have stateful components?

emberchord
Автор

I am getting TypeError: Cannot read property 'map' of undefined
class PropertiesList extends Component {
27 | getUserProfile()
28 | {
> 29 | return this.props.users.map((user) =>{
30 | return (
31 | <li
32 | );

....
....
function mapStateToProps(state){
return {users: state.users}
}
export default

RanjithKumar-fibx
Автор

I love you Bucky Lasek, you are a good skateboarder too.

aaronrood
Автор

Awesome and easy explanation to react-redux :)

vikashkaushik
Автор

I don't know...but i keep bumping into the same issue with all tutorials about this subject....how the heck do you pass the argument "state" into the mapStateToProps(state) as the store?? All the time the explanation is that the state is the store and that the store is injected into the props. How come? Where is the store imported in the container/component? Or is it happening through the <provider store={store}/>?? Or in other words...how is the function mapStateToProps aware of the store content? HOWWW???

moldovandorin
Автор

Really like your humorous way of explaining technology, which makes this piece of cold knowledge way more warm and interesting!

bingjingxu
Автор

So can we say mapStateToPros is a HOC(higher order component) which takes the component as argument and inject the state object as props? OR Connect method does something different over it.

harshittiwari
Автор

Hey why does the return portion of mapStateToProps have curly braces surrounding the content, but the return for UserList is enclosed by parentheses?

davidsonpoole
Автор

let me be clear, *" users: state.users "*
the *" users: "* props is user defined right?, we can use whatever name to call it right?
then the *"state.users"* value is the state from the reducers right?


well, because everybody said maptoprops take the app state,
so my first expectation is the *" users: "* is a part of the state

in other tuts and document, i never see the props name is defined everywhere,
so i guess, it's a name that defined in the mapStateToProps only

correct me if i'm wrong, im still a beginner

jensenraylight
Автор

You're the man Bucky! Thanks for de-mystifying :)

TheYakMaster
welcome to shbcf.ru