I have the following code snippet that works fine in the console, but it's not displaying to the screen. Any help is appreciated.
{Object.keys(flags).forEach(product => {
return (
<>
<input
type='checkbox'
className='form-checkbox'
name={product}
value={product}
onChange={this.gatherFormData}
/>
<span className='label'>{product}</span>
</>
);
})}
The product key is not displaying on the screen, even though I can see it just fine within the console.
Update: Thought I'd update this question to give the answer below since no-one posted their solution from the all the comments made.
The following uses the .map loop rather than .forEach loop, since the .forEach loop does not output content to the screen. If you want to see the results, you'll have to console.log it to the screen.
{Object.keys(flags).map(product => {
return (
<>
<input
type='checkbox'
className='form-checkbox'
name={product}
value={product}
onChange={this.gatherFormData}
/>
<span className='label'>{product}</span>
</>
);
})}