Reputation: 71
Here is the code which shouldn't throw any error as per the syntax of redux but it gives an error at line where payload is located.It is
Error: 'Unexpected token, expected ;'
// code part
const xyz =(response)=>{
return
{
type:GET_ALL_ABC,
payload:{
response,
}
};
}
Upvotes: 0
Views: 34
Reputation: 3401
Your code should be
const xyz =(response)=>{
return ({
type:GET_ALL_ABC,
payload:{
response,
}
});
}
with your code the function after compiling will be
const xyz = response => {
return;
{
type:GET_ALL_ABC,
payload:{
response,
}
};
}
}
Upvotes: 1