I am trying to call a function to render table rows using the map function on an array of texts I receive as props but for some reason they are not being rendered. Am I making a syntactical mistake? I have verified that the license text props array is not empty and simply returns an array of strings.
const showLicenseText = () => {
return licenseText.map(text => {
<tr>
<ThPadding>
License Information
{':'}
</ThPadding>
<td>{text}</td>
</tr>
})
}
The original code in render method is:
return (
<table>
<tbody>
{bbbFileOpenDate && (
<tr>
<ThPadding>
{text.bbbFileOpened}
{':'}
</ThPadding>
<td>{bbbFileOpenDate}</td>
</tr>
)}
{yearsInBusiness && !isOutOfBusiness && (
<tr>
<ThPadding>
{yearsInBusinessLabel}
{':'}
</ThPadding>
<td>{yearsInBusiness}</td>
</tr>
)}
{businessStartDate && (
<tr>
<ThPadding>
{businessStartDateLabel}
{':'}
</ThPadding>
<td>{businessStartDate}</td>
</tr>
)}
{showLicenseText}
{locationStartDate && (
<tr>
<ThPadding>
{locationStartDateLabel}
{':'}
</ThPadding>
<td>{locationStartDate}</td>
</tr>
)} ....
return ( <tr> etc..</tr> )?