score:1

Accepted answer
class ListResult extends React.Component{
    constructor(props){
    super(props);
  }
  
  render(){
    const numbers = this.props.numbers;
    const result = numbers.map(e=><li>{e*2}</li>)
    return(
        <div>
          <p>The result is:</p>
        <ul style={{listStyleType: 'disc'}} >{result}</ul>
        </div>
    )
  }
}
const numbers = [1,2,3,4,5];
ReactDOM.render(<ListResult numbers={numbers} />, document.getElementById('root'));

Related Query

More Query from same tag