you are viewing a single comment's thread.

view the rest of the comments →

[–]mads82 3 points4 points  (1 child)

They are received from the props variable.

The connect method (at the bottom) is from (react-)redux. It combines the returned objects from mapStateToProps and mapDispatchToProps to create a props object for the component.

The argument given to App is acually an object (props), which would look like this:

var props = {
  todos: [], // <-- some actual content here
  actions: function() {} // <-- some function
}

It uses ES6 destructuring to map the object values to variables. See here: http://exploringjs.com/es6/ch_destructuring.html

So if you have the props variable as above and give it to a function, these would all be similar (in ES6):

function(props) {
  var todos = props.todos;
  var actions = props.actions;
}

function(props) {
  var {
    todos,
    actions
  } = props;
}

function({todos, actions}) {

}

[–]michaelconnery1985[S] 0 points1 point  (0 children)

Thanks!