view raw
Vlad Stan Vlad Stan - 8 months ago 152
Javascript Question

Why I get Error: assigning to rvalue?

I have a map() and I want to pass two params, one string and a function, like this code here:

{ (workflow, totalWorkflow())=> {
return <WorkflowSingle key={workflow} workflow={workflow}/>

I got this error: Assigning to rvalue
Any idea why?


If your map function is the function, you passed wrong parameters to the function, map accepts callback and second optional parameter, like this:[, thisArg])

For your case: {
    return <WorkflowSingle key = { x.workflow } workflow = { x.workflow } />