Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, react, react-native
- 領域
- mobile-dev
調査の方向性
Issue に示されている Splash コンポーネントから始め、特にその render メソッドと、インポートされている React Native およびローカルモジュールを確認します。アプリの起動時に警告を再現し、次にどのレンダリング値が undefined なのかを追跡します。無効な型の警告が表示されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
import React, { Component } from "react";
import {PermissionsAndroid,View,StyleSheet,Animated,Dimensions,AsyncStorage} from "react-native";
import { CommonActions } from '@react-navigation/native';
import { Constants } from '../common';
import utils from "../utils";
import DeviceInfo from 'react-native-device-info';
import { getUniqueId, getManufacturer } from 'react-native-device-info';
const { width } = Dimensions.get('window');
const resetLoginAction = CommonActions.reset({
index: 1,
routes: [
{ name: 'Home' },
],
})
const resetActionApp = CommonActions.reset({
index: 1,
routes: [
{ name: 'SignIn' },
],
})
let uniqueId = DeviceInfo.getUniqueId();
export default class Splash extends Component {
constructor(props) {
super(props);
this.state = {
ready: false,
SlideInLeft: new Animated.Value(0),
slideUpValue: new Animated.Value(0),
fadeValue: new Animated.Value(0),
}
}
async componentDidMount() {
this._start()
setTimeout(() => {
this._retrieveData()
}, 3000);
}
_start = async () => {
return Animated.parallel([
Animated.timing(this.state.SlideInLeft, {
toValue: 1,
duration: 500,
useNativeDriver: true
}),
Animated.timing(this.state.fadeValue, {
toValue: 1,
duration: 500,
useNativeDriver: true
}),
Animated.timing(this.state.slideUpValue, {
toValue: 1,
duration: 500,
useNativeDriver: true
})
]).start();
};
_retrieveData = async () => {
try {
const value = await AsyncStorage.getItem('LoginDetails');
// console.log(value+"data get")
if (value !== null) {
if(JSON.parse(value).is_guest) {
this.props.navigation.dispatch(resetLoginAction);
}
else {
utils.setUserData(value);
this.props.navigation.dispatch(resetLoginAction);
}
} else {
this.props.navigation.dispatch(resetActionApp);
}
} catch (error) {
console.log(error);
// Error retrieving data
}
};
render() {
let { slideUpValue, fadeValue, SlideInLeft } = this.state;
return (
<Animated.Image
source={Constants.Splash_bg}
style={{
transform: [
{
translateY: slideUpValue.interpolate({
inputRange: [0, 1],
outputRange: [-200, 0]
})
}
],
flex: 1,
width: width,
resizeMode: 'contain',
justifyContent: "center"
}}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FFF",
alignItems: "center"
},
item: {},
btn: {
backgroundColor: "#480032",
width: 100,
height: 40,
padding: 3,
justifyContent: "center",
borderRadius: 6,
marginTop: 29
},
text: {
fontSize: 20,
color: "#fff",
fontWeight: "bold",
textAlign: "center"
},
item1: {
backgroundColor: "red",
padding: 20,
width: 100,
margin: 10
},
textBtn: {
color: "#f4f4f4",
fontWeight: "bold",
textAlign: "center"
}
});
- 主要言語
- JavaScript
- スター
- 13.2k
- フォーク
- 1.3k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
expo/create-react-native-app のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
expo/create-react-native-app#947 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 10/100
expo/create-react-native-app#946 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
expo/create-react-native-app#945 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
expo/create-react-native-app#931 · コメント 14 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
expo/create-react-native-app#927 · コメント 2 件 · リアクション 1 件 ·
expo/create-react-native-app の issue をすべて見る
似ている issue
-
bug data-types
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ClickHouse/clickhouse-js#1293 ·
メンテナーはふだん 1 日以内に返信
-
area: tests help wanted size/s
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
DahanItamar/DockNest#368 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100