4
非同期Webサービスリクエストが終了したら、動的HTML文字列をwebviewにロードします。これどうやってするの?webviewで動的HTML文字列を読み込む方法
<WebView source={{html: dynamichtml}}/>
getMoviesFromApiAsync()
{
return fetch('*****some url*****')
.then((response) => response.json())
.then((responseJson) => {
this.setState({isLoading: false, jsonData: responseJson});
this.getDataFromServer(responseJson);
return responseJson;
})
.catch((error) => {
console.error(error);
});
}
getDataFromServer(responseJson)
{
var a ='ravi';
var b = 'chennai';
var commonHtml = `my name is ${a} from ${b}`;
<WebView source={{html: commonHtml}}/> // not working
}
こんにちは、どんな進歩? – jose920405