expo

React Native - setState on object inside state

僤鯓⒐⒋嵵緔 提交于 2019-12-25 08:37:12
问题 I have two text inputs on modal screen, when I'm filling first input - state is updated, and when I jump on second input and start typing - value of the first input is empty. Here is code: constructor(){ super() this.state={ Modal: { EduModalVisible: false, ProTitleModalVisible: false, PsychoModalityModalVisible: false, }, User: { NameOfFaculty: '', YearOfGraduate: '', } } } And text input looks like this: <TextField label={'Faculty'} highlightColor={'#76a6ef'} value={this.state.User

Open a modal on BottomTabNavigator click react-native

最后都变了- 提交于 2019-12-24 10:19:08
问题 I was trying to open a modal from bottomnavigator , was following this tutorial - https://snack.expo.io/SyJKMkFUM I am using react-navigation -3.0.9 here is my app.js class App extends React.Component { renderItem = (route, index) => { const { navigation, jumpToIndex, } = this.props; const isCapture = route.routeName === 'Capture'; const focused = index === navigation.state.index; return ( <TouchableWithoutFeedback key={route.key} onPress={() => isCapture ? this.props.navigation.navigate(

react-native-i18n module linking with expo

ε祈祈猫儿з 提交于 2019-12-24 08:57:45
问题 I am building an app using Create-React-Native-App. As such, my testing and development is in Expo. I am looking for a solution to help with i18n, mostly translations and RTL. I found that ex-react-native-i18n works great, until I try ejecting to create the App, because it needs expo. (Which I don't need or want in the production App) with react-native-i18n I get this error: react-native-i18n module is not correctly linked I tried react-native link and yarn link without success. The ReadMe

React.createElement: type is invalid on Expo

落爺英雄遲暮 提交于 2019-12-24 06:44:58
问题 I'm just starting to learn React Native and I tried to do RN on Expo. Now I'm getting this error. Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in. My code is import React from 'react'; import {Text, AppRegistry} from 'react-native'; const App = () => ( <Text>Some Text </Text> ); AppRegistry.registerComponent(

Sort and Group React Native SectionList by Key

社会主义新天地 提交于 2019-12-24 05:24:07
问题 I have a SectionList which I populate with data from firebase. The list shows event info sectioned by date, with the current month visible as THIS MONTH and the other dates using their shorthand value of JAN , FEB etc.. I get the data fine and can display it fine but I can't figure out how to group the data array by the dates. FYI the dates are saved in the db as date strings ' 2019-01-05 ' and i use moment to format them with this method: formatDateToMonth(date) { let fullDate = moment(date)

What is the difference between Expo CLI and React Native CLI? [duplicate]

痞子三分冷 提交于 2019-12-23 13:38:16
问题 This question already has answers here : What is the difference between Expo and React Native? (8 answers) Closed 10 months ago . React Native provides two way to create Project. First: npm install -g expo-cli Second: npm install -g react-native-cli so what is different between them and what should be used if we create react native app? 回答1: React Native init: Advantages: You can add native modules written in Java/Objective-C (probably the only but the strongest one) Disadvantages: Needs

React Native ScrollView/FlatList not scrolling

你。 提交于 2019-12-23 10:15:15
问题 I have a list of data that I want to place inside a FlatList (i.e. ScrollView) and whenever I try to scroll down to view more of the list, the ScrollView just bounces back up to the top of the list so I cannot ever see the bottom of the list. I am using Expo and the strange thing is that if I just create a new project or copy/paste some code into Snack then the scrolling works just fine. It is only in my current project that I cannot get the list to scroll. I have even gone into the main.js

Running ejected project throws “Expo sdk required expo to run”

大城市里の小女人 提交于 2019-12-23 08:58:24
问题 I created react-native project using create-react-native-app. In this I am importing Permissions module from expo, import {Permissions} from "expo"; Later I realised that expo doesn't fullfill all my requirements (like social sharing etc), so I decided to eject the expo project. I ran following command to do so "npm run eject" After detaching, I installed expo as my project dependency to resolve imported Permissions module from expo. "npm install expo" Now when I run "npm run ios", I get this

Where to Set EXPO_DEBUG value in ReactNative app?

痴心易碎 提交于 2019-12-23 07:26:29
问题 When I try to login in expo I got this error : [exp] Set EXPO_DEBUG=true in your env to view the stack trace. Do you know where exactly I have to set the value of EXPO_DEBUG ? 回答1: EXPO_DEBUG is an environment variable, so you can set it by typing export EXPO_DEBUG=true in your shell. 回答2: Just Simply Put the Following command in Window os in Sequence it will definitely work. 1)Cd Project_Dir>Set EXPO_DEBUG=ture Then 2)Cd Project_Dir>expo start Working fine for me. 回答3: You can do it simple:

Expo Linear Gradient transparent is showing up blackish

喜欢而已 提交于 2019-12-23 02:38:18
问题 I'm trying to get a bottom to top white to transparent-white transition in my React Native screen using Expo Linear Gradients: https://docs.expo.io/versions/latest/sdk/linear-gradient.html I copied the second example and flipped it around, and made it white instead of black. But now the "transparent" the white is supposed to fade in to is darker that the white is, see below: The transparent actually is see through so that's good but is there a way to give it a white hue? Code here: