react-native

https undefined in react native axios

China☆狼群 提交于 2021-02-18 07:45:08
问题 I have used axios for react native app but while implementing https.agent it shows https is undefined. How to solve this? My code const instance = axios.create({ httpsAgent: new https.Agent({ rejectUnauthorized: false }) }); instance.get('https://example.com'); // At request level const agent = new https.Agent({ rejectUnauthorized: false }); axios.post('/practz/login', { "username" :"orgadmin1@example.com", "password":"exam", "appId":"AABBCD", "domainName":"example.com", httpsAgent: agent })

How to change theme color throught the Toggle in React Native?

久未见 提交于 2021-02-18 03:39:13
问题 I want to change the theme color of the App. like my present theme is light but I want to change the theme like Dark Mode with helping the toggle button. Some work is doing in my Application. link: https://www.howtogeek.com/361407/how-to-enable-dark-mode-for-youtube/ I build this application but in not working Global, Its only work in the present page like working in the setting page but not working the home page or profile page I don't have source code but I working this type https://www

Change status bar color with react-navigation

余生颓废 提交于 2021-02-17 19:33:10
问题 I use a DrawerNavigator from react-navigation in my app. Without any customization, the Android status bar is blue, and not black. I tried to do StatusBar.setBackgroundColor('#000000'); but it only works for a few seconds, and then it goes back to blue. It seems that something I am using set the status bar color to blue. However, I tried to remove all dependencies and only keep react-navigation, and it still happens and the docs of react-navigation do not say anything about that. How can I

How to store records in an array using AsyncStorage

元气小坏坏 提交于 2021-02-17 18:59:28
问题 Just now I started using AsyncStorage. I tried storing input text value like this: class Sample extends React.Component{ constructor(props){ super(props); this.state = { Name:' ', }; } componentDidMount() { AsyncStorage.getItem("Name").then((value) =>{ this.setState({"Name":value}) }).done(); handleChange(e){ AsyncStorage.setItem("Name", e.nativeEvent.text) this.setState({ email: e.nativeEvent.text }) } render(){ return( <View> <TextInput style={styles.textContainer} value={this.state.Name}

The development server returned response error code: 500 in react native

我的未来我决定 提交于 2021-02-17 18:40:47
问题 I am using react-native framework for developing my android app. I want to use react-native-material-design library for making Toolbar with some more features. I installed this library in current directory where my project is using below command :- E:\>npm i react-native-material-design -g --save C:\Users\ch-e00925\AppData\Roaming\npm `-- react-native-material-design@0.3.7 +-- react-native-material-design-styles@0.2.6 (git+https://github.com/react-n ative-material-design/react-native-material

The development server returned response error code: 500 in react native

允我心安 提交于 2021-02-17 18:40:32
问题 I am using react-native framework for developing my android app. I want to use react-native-material-design library for making Toolbar with some more features. I installed this library in current directory where my project is using below command :- E:\>npm i react-native-material-design -g --save C:\Users\ch-e00925\AppData\Roaming\npm `-- react-native-material-design@0.3.7 +-- react-native-material-design-styles@0.2.6 (git+https://github.com/react-n ative-material-design/react-native-material

The development server returned response error code: 500 in react native

主宰稳场 提交于 2021-02-17 18:40:26
问题 I am using react-native framework for developing my android app. I want to use react-native-material-design library for making Toolbar with some more features. I installed this library in current directory where my project is using below command :- E:\>npm i react-native-material-design -g --save C:\Users\ch-e00925\AppData\Roaming\npm `-- react-native-material-design@0.3.7 +-- react-native-material-design-styles@0.2.6 (git+https://github.com/react-n ative-material-design/react-native-material

React Native: Unable to resolve module fs

99封情书 提交于 2021-02-17 15:11:56
问题 Unable to resolve module fs from /...mypath I got this error when trying to import a node module into my react-native app. The module used 'fs' in this way: var fs = require('fs'); var list = JSON.parse(fs.readFileSync(__dirname + '/list.json', 'utf8')); 回答1: React Native applications do not run in the Node.js environment (it is only used by the packager to actually serve and compile your application bundle). Since your app is running inside JS VM on either iPhone or Android, the only way to

Clean react native project

半腔热情 提交于 2021-02-17 14:32:29
问题 How to clean react native project? Is there any way to clean react native project as we can clean xcode project? Any help will be appreciated! 回答1: A react-native Project is about one XCode Project and one Android Project . (for pure js code, there's no need to do clean) So, what you need would be Clean XCode Project with cd ios xcodebuild clean And then clean Android Project with cd android ./gradlew clean You can simply write a batch file for it. 回答2: For android project cd android &&.

How to make phone call in React Native?

倾然丶 夕夏残阳落幕 提交于 2021-02-17 08:25:00
问题 I want to call to the value of Text component when I press it. But, actually, I haven't enough knowledge for that. Can you, please, tell me, which library or component should I use? 回答1: If you look at the source code for react-native-phone-call , it's ultimately just a wrapper for: import {Linking} from 'react-native' Linking.openURL(`tel:${phoneNumber}`) 回答2: You can use this method to call numbers in android and ios, place this method in a utils file and use the method wherever you want.