のWebViewを表示しませんネイティブ反応し、私は問題に直面している:は私がアプリを開発してい
私が欲しいという私が直接ビューをボタンをクリック(またはときボタンがどこにあるか)、Webviewが画面に表示され、直接パラメータで渡されたリンクを開きます。 しかし何も起こりません。
return (
<ScrollView style={[style.case1]} refreshControl={<RefreshControl refreshing={this.state.refreshing} onRefresh={this.handleRefresh} />} >
{
this.state.orders.map(function (order) {
let a = _this.getPosts(order);
let Final = _this.splitString(a.message," ");
return (
<View style={[style.case2]} key={a.message} >
<Couleur couleur={Final[4]} />
<Text style={[style.Nom]} >Nom : {Final[1]}</Text>
<Text style={[style.Nom]} >Numéro de build : {Final[2]}</Text>
<Button onPress={<Web url={Final[3]} />} title="Click"/>
</View>
);
})}
</ScrollView>
);
とのWebViewクラス:ここ
が私のコードであるimport React, {Component} from "react";
import {WebView} from "react-native";
export default class Web extends Component {
constructor(props){
super(props);
}
render() {
let uri = this.props.url;
return(
<WebView
ref={(ref) => {this.webview = ref;}}
source={{uri}}
style={{marginTop:20}}
/>
)
}
}
、私はこのエラーを得た:
「オブジェクトは関数ではありませんが(「これを評価します.props.onPress(e) ')
誰かが私を助けてくれたらとてもうれしいです! :)
あなたはこの 'たonPress = {()=>リターンのように変更しようとしています} '? –
私はあなたのソリューションを入力するときにエラーが発生しましたが、私は '返品'を削除すると、私は今何もエラーがありません。 –
しかし、私はまだWebViewを表示していません。助けてくれてありがとう –