I have this code that returns a component:
const Test = ({places}) => (
<div>
{places.map(place => (
<div className="location" key={place.slug}>
<div className="photo" style={ { backgroundImage: "url(" + place.src + ")" } }></div>
<h2>{place.name}</h2>
</div>
))}
</div>
);
but I'm getting confused between ( and { brackets. I'm actually trying to get rid of the outer <div> tags but it doesn't seem to work when I use:
const Test = ({places}) => (
{places.map(place => (
<div className="location" key={place.slug}>
<div className="photo" style={ { backgroundImage: "url(" + place.src + ")" } }></div>
<h2>{place.name}</h2>
</div>
))}
);
Test? maybe you can use it as a function instead of a ComponentTestand we'll see if it can be replaced.