Questions tagged [react-native-component]
67 questions
15
votes
1 answer
ReactNative Swift component: how to set the constructor
I have been working on a ReactNative project for a week now, and I want to make my own Objc/Swift native component.
I followed the official documentation but I find it not that detailed. I can use a callback etc, and I also followed this, but I…

Anthony
- 804
- 3
- 12
- 32
7
votes
3 answers
How to remove screens (unmount component) from react native drawer-navigator on log out?How to reload Components Data?
I am using react navigation v3 in my app, I use stack navigator inside drawer navigator ,On the click of logout I navigate to login screen with clearing storage of user, But whenever I login again , Main component dose not call componentWillMount or…

Hrishi
- 1,210
- 1
- 13
- 25
6
votes
1 answer
Google Maps SDK for Android: Smoothly animating the camera to a new location, rendering all the tiles along the way
Background
Many similar questions seem to have been asked on SO before (most notably android google maps not loading the map when using GoogleMap.AnimateCamera() and How can I smoothly pan a GoogleMap in Android?), but none of the answers or…

Kenny83
- 769
- 12
- 38
6
votes
2 answers
How do you make rounded corners on a tab bar on React Native with React Navigation?
Stack:
React Native
React Navigator
Core components only
I have this style on TabNavigator.tsx:
const styles = StyleSheet.create({
tabStyle: {
backgroundColor: colors.background,
borderTopLeftRadius: 40,
borderTopRightRadius: 40,
…

Xiiryo
- 3,021
- 5
- 31
- 48
6
votes
2 answers
React Native is there an attribute equals to alt on image component
Coming from reactjs i was expecting "alt" attribute on the image component that will show text in case the image could not be loaded.
I read the documentation here and the closest thing I found is the on error event.
Is there an attribute equal to…

yonBav
- 1,695
- 2
- 17
- 31
4
votes
1 answer
How to use Ref in a component that is forwarding its ref in React Native
I have a react native custom input component and I'm successfully forwarding its ref to a parent component.
Now, I also want to refer to the input in the child itself, How do I do this??
//my imports here
//my text field component
export const…

Stuart Maleka
- 131
- 5
4
votes
7 answers
How to toggle-off the react-native-elements tooltip from another component
I want to manually close the tooltip but there are no documents on the react-native-elements site.
So I look over the tooltip code from github and noticed that it has a toggleTooltip function to toggle. Unfortunately I couldn't make it work.
This…

Hade Heinrich Camacho
- 41
- 1
- 3
4
votes
1 answer
Can I cause React Native's Switch component to animate when changing its state when not being directly pressed by the user?
In my React Native project I'm using the Switch component. It can be switched directly by pressing it, but I also want to let the user change it by pressing nearby related items.
It of course animates the switching when pressed, but when I changed…

hippietrail
- 15,848
- 18
- 99
- 158
3
votes
2 answers
React Native TextInput onFocus does not allow onPress of other child components
Nested TextInput component does not allow other components' onPress function to be called. Only when the TextInput is not focused, the onPress works fine.
React Native Version : 0.66.3
Here is my code
export const Component = (props): JSX.Element {
…

Syed Mustaqhim
- 453
- 3
- 13
3
votes
1 answer
How to mock a third party react-native component with jest?
I am using the NumericInput and it works fine when I run the application on my device.
However, when I run jest, I get all kind of errors:
TypeError: Cannot read property 'default' of undefined
at new Icon…

Maxime Dupré
- 5,319
- 7
- 38
- 72
3
votes
2 answers
React Native TypeScript TextInput not working
I am trying to learn react native by doing a basic application. I followed many tutorials available online and made the following class for a login screen:
import React, { Component } from "react";
import { View, StyleSheet, TextInput, Button,…

Harikrishnan
- 7,765
- 13
- 62
- 113
2
votes
1 answer
React Native Android build failing with 'compileDebugJavaWithJavac' on several packages
I've been working in the same React Native project for months and recently the Android build has started failing. To my knowledge I haven't changed anything about my development environment and I haven't updated or changed any packages or…

gsdev
- 23
- 3
2
votes
0 answers
Expo standalone app crashes when opening a screen uses react-native-maps component
I am developing an Expo Application that uses react-native-maps. the application works absolutely fine when I open it in Expo Client. but android "APK" build of standalone app reloads every time I open a screen that includes react-native-maps.
I did…

Abdel Rahman
- 121
- 5
2
votes
3 answers
Showing different component after every certain number of items in FlatList
I am using FlatList to show my card components in my app.
And I want to show another component (like an ads or an announcement component) after certain numbers of cards in the list.
As an illustration, it should look like as below;
card item
card…

Uğur Genç
- 121
- 8
2
votes
1 answer
I have a list of items which i want to pass navigation to it using react native navigation
I have a list of items which i want to pass navigation to it using react native navigation, here is my main code,
import React from 'react'
import { StyleSheet, Text, View, TouchableOpacity, ScrollView, Image } from 'react-native'
import…

Yashas Km
- 23
- 4