To display the state value , you should have already state values defined in React & you have proper values present in state .
Suppose We have the state defined as –
constructor(props) {
super(props);
this.state = { items: [], orange: '' };
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
Now to display this above state value , you could use map function like –
render() {
return (
<ul>
{this.props.items.map(i => (
<li key={i.id}>{i.text}</li>
))}
</ul>
);
}
‘ul’ means unordered list & ‘li’ is list items , in above code we are rendering items value & items id , which is present under items in state.