I\'m still learning ReactJS. I\'m challenging myself to write a very basic todo app (as one does) and I\'m having an issue calling an onClick function.
var L
The second argument for the map function is a value to define the scope of
this
when executing the callback.:
.map( callback( currentValue, index, array), value_for_this/scope_to_run_in )
So you can modify your map
function as follows:
var items = list.map(function(item){
return (
-
);
}, this);
You could also use an arrow function which where
this
is implicitly bound:
var items = list.map((item) => {
return (
-
);
});