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.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react, react-native
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu từ component Splash được hiển thị trong issue, đặc biệt là phương thức render của nó cùng các module React Native và module cục bộ được import. Tái hiện cảnh báo trong quá trình khởi động app, sau đó truy vết giá trị được render nào là undefined; hoàn thành khi cảnh báo về kiểu không hợp lệ không còn xuất hiện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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"
}
});
- Ngôn ngữ chính
- JavaScript
- Star
- 13.2k
- Fork
- 1.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của expo/create-react-native-app
-
eas.json error on buildingĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
expo/create-react-native-app#947 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 10/100
expo/create-react-native-app#946 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
expo/create-react-native-app#945 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
expo/create-react-native-app#931 · 14 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
expo/create-react-native-app#927 · 2 bình luận · 1 reaction ·
Tất cả issue của expo/create-react-native-app
Issue tương tự
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: tests help wanted size/s
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
DahanItamar/DockNest#368 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100