react-native

React Native: Inserting new object inside Array

孤人 提交于 2021-02-15 07:11:57
问题 after successfully implementing sockets, i can now listen to my event from one screen to another. My problem now is that i want to display the new object that i obtained inside my flatlist. Here is the new msg object: messages: Object { "conversationId": 33, "message": "Heyy", "receiverId": 43, "senderId": 53, } Here is my code: const [listings, setListings] = useState([]); const loadListings = async () => { setLoading(true); const response = await messagesApi.getMessages(); setLoading(false)

How to have a heart beat animation with React native?

余生长醉 提交于 2021-02-14 18:43:20
问题 I'm learning React native and I would like to have heart beat animation I did that but it's not the good result, I would like to have heart beat. If someone can help me it's would be very nice thanks a lot import React, { PureComponent } from "react"; import { Animated, StyleSheet, Text, View } from "react-native"; export class Loading extends PureComponent { constructor(props: any) { super(props); this.state = { opacity: new Animated.Value(0), }; } public componentDidMount() { Animated

How to have a heart beat animation with React native?

心已入冬 提交于 2021-02-14 18:42:17
问题 I'm learning React native and I would like to have heart beat animation I did that but it's not the good result, I would like to have heart beat. If someone can help me it's would be very nice thanks a lot import React, { PureComponent } from "react"; import { Animated, StyleSheet, Text, View } from "react-native"; export class Loading extends PureComponent { constructor(props: any) { super(props); this.state = { opacity: new Animated.Value(0), }; } public componentDidMount() { Animated

How to have a heart beat animation with React native?

佐手、 提交于 2021-02-14 18:35:07
问题 I'm learning React native and I would like to have heart beat animation I did that but it's not the good result, I would like to have heart beat. If someone can help me it's would be very nice thanks a lot import React, { PureComponent } from "react"; import { Animated, StyleSheet, Text, View } from "react-native"; export class Loading extends PureComponent { constructor(props: any) { super(props); this.state = { opacity: new Animated.Value(0), }; } public componentDidMount() { Animated

How to navigate with react navigation outside react component?

99封情书 提交于 2021-02-11 18:10:17
问题 I'm building a code to check if access_token or refresh_token are valid. I'm using axios interceptors to check the response to generate new token. How to use navigate(React Navigation) inside axios interceptors? Error: 09:53:55.852 client_log FarmsList:React.FC -> error [Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons axios.interceptors.response.use( (response) => { return response }, async

Works in debug but not in release | expo-av | react-native-unimodules

醉酒当歌 提交于 2021-02-11 17:20:21
问题 Environment Expo CLI 3.11.1 environment info: System: OS: Windows 10 Binaries: Yarn: 1.22.4 - C:\Users\user\AppData\Roaming\npm\yarn.CMD npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6308749 React-native android on device Step to repro : 1. npx react-native init ReactRelease --version 0.62.2 npm install react-native-unimodules@0.9.0 --save expo install expo-av 2. Configure your files according to the doc in each library 3. Edit App.js

Works in debug but not in release | expo-av | react-native-unimodules

百般思念 提交于 2021-02-11 17:15:41
问题 Environment Expo CLI 3.11.1 environment info: System: OS: Windows 10 Binaries: Yarn: 1.22.4 - C:\Users\user\AppData\Roaming\npm\yarn.CMD npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6308749 React-native android on device Step to repro : 1. npx react-native init ReactRelease --version 0.62.2 npm install react-native-unimodules@0.9.0 --save expo install expo-av 2. Configure your files according to the doc in each library 3. Edit App.js

React native - FETCH - Authorization header not working

痞子三分冷 提交于 2021-02-11 16:52:40
问题 I made a server query via an app developed using react-native. I used fetch API and it turns out any query with authorization header not working. POST and GET method REQUESTS that don't expect Authorization headers at the server side works well. Some Queries at the server side are protected with authorization and when I make such queries including authorization header, I always get '401:unauthorized' error. But such queries works well with POSTMAN. Any suggestions here would be of great help.

React Native Modal doesn't show animations

随声附和 提交于 2021-02-11 16:51:31
问题 So in my App, I have a working Modal that shows if the visibility is set to true. It also closes correctly and everything works fine(except the bug where if you reload the emulator and the Modal is open it stays open and you can't close it). I am using react-native-modal package. My problem is that the animations don't work in the Modal. The "animationIn" prop doesn't show any change if I set the value for example to "slideInLeft" neither does the "animationOut" prop change anything. Does

React native - FETCH - Authorization header not working

岁酱吖の 提交于 2021-02-11 16:48:06
问题 I made a server query via an app developed using react-native. I used fetch API and it turns out any query with authorization header not working. POST and GET method REQUESTS that don't expect Authorization headers at the server side works well. Some Queries at the server side are protected with authorization and when I make such queries including authorization header, I always get '401:unauthorized' error. But such queries works well with POSTMAN. Any suggestions here would be of great help.