前提・実現したいこと
ここに質問の内容を詳しく書いてください。
react-nativeでボタンを押した時に画像とその画像の名前を表示するものを作りたいと思っています
発生している問題・エラーメッセージ
Error: Exception in HostFunction: Malformed calls from JS: field sizes are different
該当のソースコード
ソースコード /** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow * @lint-ignore-every XPLATJSCOPYRIGHT1 */ import React, {Component} from 'react'; import { Platform, StyleSheet, Text, View, StatusBar, AppRegistry, TextInput, Button, ScrollView, FlatList, Image, Picker, Alert, TouchableOpacity, } from 'react-native'; import ReactNativeTooltipMenu from 'react-native-tooltip-menu'; type Props = {}; export default class App extends Component<Props> { constructor(props) { super(props); this.state = { list: [], currentIndex: 0, text: "", name: "", username: "", userimg: null, pandaimg: require('./img/panda.png'), penguinimg: require('./img/penguin.png'), } render() { return ( <View style={[styles.base1, styles.box1]}> <ReactNativeTooltipMenu buttonComponent={ <View style={[styles.imgname]}> <Image style={[styles.image]} source={(this.state.userimg)} /> <Text style={styles.imagetext}>{this.state.username}</Text> </View> } items={[ { label: "ぶた", onPress: () => this.setState({username: <Text>ぶた</Text>}), onPress: () => this.setState({userimg: <Image style={[styles.image]} source={require('./img/panda.png')} />}), }, ]} />
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
初心者で見にくいかと思いますがよろしくお願いします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。