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.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, react, react-native
- Área
- mobile-dev
Línea de trabajo
Comienza con el componente Splash mostrado en el issue, especialmente con su método render y los módulos de React Native y locales importados. Reproduce la advertencia durante el inicio de la app y luego rastrea qué valor renderizado es undefined; se considera terminado cuando la advertencia de tipo no válido ya no aparece.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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"
}
});
- Lenguaje dominante
- JavaScript
- Estrellas
- 13.2k
- Forks
- 1.3k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de expo/create-react-native-app
-
eas.json error on buildingAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
expo/create-react-native-app#947 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 10/100
expo/create-react-native-app#946 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
expo/create-react-native-app#945 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
expo/create-react-native-app#931 · 14 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
expo/create-react-native-app#927 · 2 comentarios · 1 reacción ·
Todos los issues de expo/create-react-native-app
Issues similares
-
bug data-types
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
ClickHouse/clickhouse-js#1293 ·
Los mantenedores suelen responder en 1 día
-
area: tests help wanted size/s
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
DahanItamar/DockNest#368 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100