Hi I'm a beginner in react, I was getting an error for scenarios when no props get passed to my component, it said something like "you can't do a map of undefined" so I added this if statement. But now I get a parsing error on line 4. Not sure' what's wrong with my code:
import React from 'react';
export const Record = props => (
if (props) {
<div className='card-container'>
{props.rows.drivingInstructions.map((val, ind) => {
return (
<tr>
<td>{ind + 1}</td>
<td>Smith</td>
<td>50</td>
</tr>
)
})}
</div>
}
{ console.log(props.rows.drivingInstructions) }
);