My website create with ReactJS and all data get from API
This is fetch code:
fetch('myApiUrl').then(response => response.json()).then(jsonData => {
this.setState({
title: jsonData.title
})
})
And this is render code:
render() {
return (<h1>{this.state.title}</h1>)
}
So, if user open the website, title show to user but if google crawl the website, title not showing to google.
How can I fix this problem and get data from api and google can read it?