react-native

(Expo with Electron) Disable native scrollbehavior

十年热恋 提交于 2021-02-11 13:21:50
问题 i wanna build a desktop app with electron and expo (electron-adapter). The problem is that the body of the nested page automatically adds a scrollbar. Does anyone have a solution for this or knows how to disable this scrollbehavior? Or how to fix the header in expo? In case you need more information please let me know! Thanks for the help! 来源: https://stackoverflow.com/questions/60600943/expo-with-electron-disable-native-scrollbehavior

onPanResponderRelease not being triggered

老子叫甜甜 提交于 2021-02-11 13:14:48
问题 I am trying to use the PanResponder on a View. The onStartShouldSetPanResponder and onMoveShouldSetPanResponder but onPanResponderMove , onPanResponderGrant and onPanResponderRelease does not get triggered at all. My react and react native versions are: "react": "^15.2.1", "react-native": "^0.30.0", Below is the code 'use strict' import React from 'react' const Icon = require('react-native-vector-icons/Ionicons') let THUMB_URLS = require('../Statics/ListingsData.js') let SidePanelComponent =

onPanResponderRelease not being triggered

…衆ロ難τιáo~ 提交于 2021-02-11 13:12:26
问题 I am trying to use the PanResponder on a View. The onStartShouldSetPanResponder and onMoveShouldSetPanResponder but onPanResponderMove , onPanResponderGrant and onPanResponderRelease does not get triggered at all. My react and react native versions are: "react": "^15.2.1", "react-native": "^0.30.0", Below is the code 'use strict' import React from 'react' const Icon = require('react-native-vector-icons/Ionicons') let THUMB_URLS = require('../Statics/ListingsData.js') let SidePanelComponent =

Having multiple connections with expo in the same time

无人久伴 提交于 2021-02-11 13:03:06
问题 I am trying to make an application with multiple users using SSE Emitter on React Native and Expo, so, for testing I need at least 4 expo connections in the same time. In this way, I used expo start on four terminal tabs and ran application in Web Browser. On the first three chrome tabs all works great, the request are fetching and sending valid data, but on the first one the requests are just pending. I thought it could be from CORS, cache control header, so I setted Cache-Control: 'no-cache

Selecting date and time “together” in react native

假如想象 提交于 2021-02-11 12:55:27
问题 Now as DatePicker doesn't include TimePicker, I am inclined to use @react-native-community/datetimepicker . But as written in its documentation, it doesn't includes a feature with which user can select date and time together. This is the code given in their documentation: const showDatepicker = () => { showMode('date'); }; const showTimepicker = () => { showMode('time'); }; return ( <View> <View> <Button onPress={showDatepicker} title="Show date picker!" /> </View> <View> <Button onPress=

What is the proper way to bundle a textfile with the app

时间秒杀一切 提交于 2021-02-11 12:49:01
问题 Using expo, I need to provide a text-file with data (a word-dictionary) to the app. How do I provide that and how do I read it into memory? 回答1: I translated my textfile to a json-formatted content. This can very easy be used. The json is parsed automatically. import data from './assets/woerter.json'; 来源: https://stackoverflow.com/questions/63104357/what-is-the-proper-way-to-bundle-a-textfile-with-the-app

React useSelector not working, what am I doing wrong?

吃可爱长大的小学妹 提交于 2021-02-11 12:46:10
问题 I have a selectors folder with the selector.js file const isRecipeFavorited = state => recipeId => { const recipe = state.find(recipe => recipe.id === recipeId) console.log(`Selector isRecipeFavourtied: ${recipeId}`) return recipe ? recipe.is_fav : false } This is my favicon.js file which calls this useSelector. import React, {useState, useEffect} from 'react' import { FontAwesome } from '@expo/vector-icons' import { View, TouchableOpacity,StyleSheet, Text, Alert } from 'react-native' import

React useSelector not working, what am I doing wrong?

半城伤御伤魂 提交于 2021-02-11 12:45:53
问题 I have a selectors folder with the selector.js file const isRecipeFavorited = state => recipeId => { const recipe = state.find(recipe => recipe.id === recipeId) console.log(`Selector isRecipeFavourtied: ${recipeId}`) return recipe ? recipe.is_fav : false } This is my favicon.js file which calls this useSelector. import React, {useState, useEffect} from 'react' import { FontAwesome } from '@expo/vector-icons' import { View, TouchableOpacity,StyleSheet, Text, Alert } from 'react-native' import

How to generate class names instead of inline styles for react-native-web?

你。 提交于 2021-02-11 12:36:50
问题 I'm running expo web build which uses react-native-web. I noticed it generates inline styles so if I render a list of items, the styles get repeated for each item. Is there a way to make it generate a unique className instead and add to the head like styled-components? 回答1: Revisited this and realized it's because the components I was using did not use the StyleSheet.create api call internally, which WILL generate atomic css classes on react-native-web. Setting a regular object as the style

Expo sdk 29/30: session cookie from login

柔情痞子 提交于 2021-02-11 12:33:28
问题 In all prev versions of Expo, I used RN fetch method to POST username/password to a Flask login endpoint. This endpoint saved user info to the session and set session cookie. It was always transparent and I never had to pass anything extra. This worked as of Expo v28. But when I upgraded to Expo 30, the server no longer sees the client as logged in. Do I need to change how I use fetch? Do I need to pass some extra parameters? 回答1: First, before login, we need to clear the old cookies using: