I have a map()
and I want to pass two parameters:
Example code:
{
values.map((workflow, totalWorkflow()) => {
return <WorkflowSingle key={ workflow } workflow={ workflow } />
})
}
Why do I get this error: SyntaxError: Assigning to rvalue
You get rvalue
error, when you use =
instead of ==
in a condition checking block.
If your map
function is the Array.prototype.map
function, you passed wrong parameters to the function, map
accepts callback and second optional parameter, like this:
arr.map(callback[, thisArg])
For your case:
values.map(function(x) {
return <WorkflowSingle key = { x.workflow } workflow = { x.workflow } />
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With