crashing android app after importing some .js files #3883
Unanswered
HackerHack224
asked this question in
Q&A
Replies: 1 comment
-
By the way, I compiled my project to .apk i used a commands |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I'm new to mobile application development. I recently became acquainted with the React-native cross-platform framework. I'm familiar with JavaScript, which is why I chose this framework.
I wanted to ask about the problem that when I wanted to do it so as not to load App.js with many lines, I wanted to divide the elements into each part, like a separate banner, a separate header, a separate menu, etc. The problem is that when I want to add the "Main.js" element see code in bellow
App.js
`import { Platform, ScrollView, StatusBar, TouchableOpacity } from 'react-native';
// import SplashScreen from './splashScreen';
import Main from './main';
// import axios from 'axios';
import React, { useEffect, useState } from 'react';
import { Svg, Path } from 'react-native-svg';
import { StyleSheet, Text, View, Button, SafeAreaView, TextInput, Image } from 'react-native';
import styles from './styles';
export default function App() {
return (
<View style={{ flex: 1 }}>
);
}`
This problem
return ( <View style={{ flex: 1 }}> <Main /> **{/*after adding this tag my app crashing*/}** </View> );
//main.js
`import { Platform, ScrollView, StatusBar, TouchableOpacity } from 'react-native';
import SplashScreen from './splashScreen';
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import { Svg, Path } from 'react-native-svg';
import { StyleSheet, Text, View, Button, SafeAreaView, TextInput, Image } from 'react-native';
import styles from './styles';
const Main = () => {
const [response, setViewColor] = useState('#f0f0f0');
const SBC = () => {
}
export default Main;`
please tell me what the problem is, maybe I didn’t install some plugin, maybe I need to add some or I made a mistake with the code
Beta Was this translation helpful? Give feedback.
All reactions