1
I am studying React and I have a problem, more precisely in the state part, where my code does not render on the screen. In this case I have a h1
and a ul
and none of them appear on the screen, but if I delete the h1
appears the ul
, and if I delete the ul
appears the h1
.
Code
class App extends React.Component {
constructor(props) {
super(props);
this.team = {Tname: "Dev's React"},
this.names = {member1 : 'Caua', member2: 'Luna', member3: 'Henry', member4: 'Barry'}
}
render(){
return (
<h1>Hello Team {this.team.Tname} </h1>
<ul>
<li> Member 1: {this.names.member1} </li>
<li> Member 2: {this.names.member2} </li>
<li> Member 3: {this.names.member3} </li>
<li> Member 4: {this.names.member4} </li>
</ul>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('app')
);