157
rated 0 times
[
164]
[
7]
/ answers: 1 / hits: 38892
/ 5 Years ago, mon, january 21, 2019, 12:00:00
I'm using Reactivesearch, and I'm trying to assign a const variable inside a map function. Specifically in the .map
Like such:
onAllData(data, streamData) {
return (
<div className=grid>
{
data.map((item) =>
const propertyName = item.productName;
<div className=flex-container card key={item._id}>
<div className=content>
<p>{propertyName}</p>
</div>
</div>
)
}
);
}
const propertyName = item.productName;
is giving me problem. Error states unexpected token
.
Is it possible?
More From » reactjs