Questions tagged [react-native]

11654 questions
1

votes
0

answer
7

Views

How to disable Crashlytics while in debug mode, in react-native-firebase?

I have enabled firebase Crashlytics inside react native application. I want to disable crash logs while working on development mode. How can I disable crash logs in debug mode for both Android and Ios Application. To create crash logs I have followed react native firebase documentation check this of...
Archana
1

votes
0

answer
17

Views

Add a gap between pie chart path in svg

I'm trying to render a pie chart through an svg with a gap/line between the slices, but I'm not currently getting the right results. This is how it should look like. This is how I've done the component, this is with reference to this medium post. import React from 'react'; import { View, ViewPropTyp...
konicakoala
4

votes
1

answer
136

Views

React Native activeTintColor not getting applied on selected drawer item

React Native activeTintColor not getting applied on selected drawer item. My react native navigation routes looks like, -> DrawerNavigator -> StackNavigator -> HomeScreen -> FirstScreen -> SecondScreen -> ThirdScreen routes.js const RootStack = createStackNavigator( { Home: { screen: HomeScreen }, C...
Avinash Raj
0

votes
0

answer
3

Views

How to reset an already reset nested StackNavigator

I have a TabNavigator and one tab is a nested StackNavigator. As the user navigates to the final screen of the StackNavigator the stack is reset since the final screen is a confirmation screen and users should not be able to swipe back and resubmit their action. This is achieved via the straightforw...
Robin Southgate
1

votes
0

answer
13

Views

Push notification service without showing actual notification in expo

Is it possible to use Expo push notifications (https://docs.expo.io/versions/latest/guides/push-notifications/) without showing actual notification to user? I want to use Firebase Cloud Messaging to notify user about change in backend and this would be perfect solution that won't require me to eject...
mck159
3

votes
2

answer
36

Views

Redux state outside redux's store

I've a situation where my react-native application has some images that I want to show, export const myImages = Map() .set('image-one, { name: 'Foo', source: require('./foo'), }) .set('image-two, { name: 'Bar', source: require('./bar'), }) I let my user to select the kind of image in question, like...
Federkun
0

votes
0

answer
2

Views

How to test third party library components with Detox in React-Native?

I have a example component code: import { Button } from 'react-native-elements' ... ... render() { return( ) } Example test file: await element(by.id('testButton')).tap() For a normal button the tests works fine. For third party button, I'm Only using react-native-elements, The test fails and shows:...
ShocKwav3_
0

votes
0

answer
5

Views

Why I am not getting notification when app is in background? I am using [email protected]

I am facing an issue in receiving the notification when the app is in the background or closed. When I close the app "ReactInstanceManager.detachViewFromInstance()" method called & notification does not come. Kindly, guide me for a way to resolve this (if any). I am using following versions: react-n...
Dev bluCursor
0

votes
0

answer
6

Views

How to do Monorepo setup with react and react native apps for sharing code between them

I want to share most of react-native login with react web. I am using react-native-web package for this. importing file in from shared folder doesn't resolve to correct path. My project setup looks like this: -MyApp --mobile --web --shared
1

votes
3

answer
33

Views

When getting input text, why is my evt.target.value always undefined?

I'm trying to pick up user input, save to a variable and then dispatch to the store. But no matter what I try I always get 'undefined', why is that? I feel like I've tried everything. I initially thought my scope was wrong. Then I thought it was just unable to setState/getState, but it is setting st...
Grant Isdale
0

votes
0

answer
7

Views

React Native ios Switch in FlatList not toggling after value changed

I am trying to toggle ios Switch in react native. But the switch comes back to initial position as soon as I change it. What I have: class ABC extends Component { constructor(props) { super(props) this.state = { obj: [] } } fetch(){ // fetch something from remote server, set it to state object array...
Partha
1

votes
0

answer
10

Views

React-Navigation - Header interaction with its screen component, Failed prop type

I am following the React-Navigation tutorial, and got stuck on the section titled Header interaction with its screen component. The code in the tutorial work fine in the emulator provided at snack, but I discovered that when running locally I encountered the following error: Warning: Failed prop ty...
Inda Vidjool
1

votes
2

answer
553

Views

How to render multiple shadows on one element?

For example, how to accomplish box-shadow: 2px 2px 4px rgba(0, 0, 0, .05), -2px -2px 4px rgba(0, 0, 0, .05); in react native stylesheet?
wengwengweng
1

votes
1

answer
3.2k

Views

How to get content height of ScrollView component for contentOffset prop in React Native?

For my current project, I'm creating a Diary/Calendar type component that shows the current day (Diary view) or current month (Calendar view) centered when the user clicks to see that view. I'm using a ScrollView to hold my content: _getInitialOffset(h) { const FIX = 75; //TODO: Make it less arbitra...
Steven Francus
9

votes
2

answer
166

Views

React Navigation weird back button behavior in nested navigators

I'm using React Navigation in my app and I have a Tab Navigator nested in a Stack Navigator. Sometimes in the app, the navigation stack is: Screen A => Tab Navigator => Screen B. So when users are in Screen B and press the back button it triggers first the back action in the Tab Navigator and only i...
Thiago Nascimento
1

votes
2

answer
3.4k

Views

Send data from between components in react native

I'm writting a simple app have 2 screen: Login and Main. In file Login.js: import React, {Component} from 'react'; import {Text, View, Button, StyleSheet, TextInput} from 'react-native'; export default class Login extends Component { constructor(props) { super(props); this.state = { user_name:...
XuHo
1

votes
1

answer
2.5k

Views

Is there a Cross platform clearButtonMode for Android with React Native

How should one implement the "X" to clear button in react native so that it works with Android as well as iOS. iOS has the text input option of "clearButtonMode" enum('never', 'while-editing', 'unless-editing', 'always'). To make it cross platform, do we need to just add an android conditional rend...
MonkeyBonkey
0

votes
3

answer
15

Views

cannot read “this” in react native function

I am trying to set the user data from facebook login and store it in a state but there is an error occurred. Facebook Authentication _fbAuth(){ LoginManager.logInWithReadPermissions(['public_profile']).then(function(res){ if(res.isCancelled){ console.log('login cancelled.') } else { AccessToken.getC...
Emerald
0

votes
0

answer
24

Views

How to get the value from a component to a variable

I have an component which uses the animation part.I would like to have the return value from the component to a variable. I have tried to like this const temp = But i am getting the response as [object, object] const temp = ; Counter Component: export default class Counter extends Component { stati...
Nidhin Kumar
0

votes
0

answer
17

Views

How to stop till progress bar finishes in react native

I have created a splash screen with progress bar ( using react-native-progress for progress bar). My goal is check user availability in this splash screen and redirect the user accordingly. I am using redux, so created a action to check if there is login token available. My Redux action for loginche...
Arvindh
1

votes
2

answer
692

Views

listView not displayed unless I scroll on it

I have a graphical bug on my react native app, and it appears only on iOS, not on android. When I update the state of my application of the History screen (on startup, or when I add a ride, or when I remove a ride), the list of my ride items in history disappears (implemented using react native List...
Jeremie
1

votes
3

answer
3.9k

Views

Passing checkbox value to show / hide Password via react native

I'm using Firebase auth I will want to add a Check box, it will display the password in the password text box and hide it when it is clicked again How to Passing checkbox value to show / hide Password? This is my Login Page Code: export default class Login extends Component { constructor(props) {...
1

votes
1

answer
2k

Views

Not able to eject again after eject react native

I am new to reactnative, I have successfully eject to a native build, and I found some thing to tweak after reactnative so I want to edit the js again and eject again. But I found it not able to eject using npm run eject again and it shows the following error: npm run eject npm ERR! Darwin 16.6.0 np...
armnotstrong
1

votes
1

answer
1.2k

Views

How can I add a border frame in the camera?

I need to add a square frame in the middle of the viewfinder of the react native camera view. There is not information about it in the repository also. And questions there is not being answered also.
Dinuka Salwathura
1

votes
1

answer
3.5k

Views

How to subtract and plus date in react native

Actually, i am stuck in one problem that is about Date. I want to subtract and plus the date in react native. is there any solution about it. I have used Moment.js but the error occurs in it so please help me. Thank you in advance
Swapnil Panchal
0

votes
0

answer
11

Views

React Native: Display FlatList data in Modal

I have a react native flat list that renders some data from a Wordpress website using wp rest api. The flat list is displaying the post correctly, and when clicked, it opens the modal, but I am having some trouble pushing the state to the modal. Currently, when the modal opens, it shows the same (la...
user1020277
0

votes
0

answer
5

Views

Is there a way to make Animated.Value an array in React Native?

I want to store the heights of multiple s in an array, and animate all of those values together. Something like this: However, when I try to do this: this.state = { heights: new Animated.Value([10, 20, 30]) } this doesn't work. Any tips?
gkeenley
3

votes
0

answer
112

Views

How to fix this crash in facebook::react::Value::toJSONString

Problem I'm getting an annoying crash report in production, which I can't solve but I think it's related to this github issue. The problem is that it looks like the crash is randomly appear, and not after a certain action. I tracked down the source of the next line, which I think have to do somethin...
Xyzor
2

votes
0

answer
24

Views

I can't navigating without the navigation prop with react-i18next container

I apply the navigation example without the navigation prop of the react-navigations docs (NavigationService), but I can't make it work with react-i18next. I applied the example of the documentation https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html in my code: // App.js impo...
Àlex
1

votes
1

answer
207

Views

How to access property on an object with React Native?

Working with React Native, unable access the brand property of my object and of course less brand.name. Does anyone know what might be happening? Thank you Code: {this.state.beer.brand.name} Object:
OscarDev
1

votes
1

answer
147

Views

Remove navigation header on screen for react native app

I want to remove header from my screen where I use bottom tab navigator. Here is code example: export class Home extends Component { render() { return ; } } export class Settings extends Component { render() { return ; } } const Main = createBottomTabNavigator({ Home: { screen: Home, navigationOptio...
Eldlabs
1

votes
1

answer
59

Views

React native navigation cross screens notification “snackbar”

Trying to implement a "No internet" notification across alot of screens in react native using react-navigation. I'm trying to avoid adding the component to all screen views render function since it feels like boilerplate. Is there a simple way to add a component in one place using react native navi...
Cisum inas
0

votes
0

answer
10

Views

React Native - Application crashes after running and applying “setInterval”

I'm here to ask a problem that I couldn't resolve for a day. After applying setInterval, my application crashes on physical android phone and in my emulator it shows an error that I'm not familiar. In physical android phone and emulator, after I log in in application and STAY for a minute in a parti...
Purple Violet
1

votes
1

answer
109

Views

react-native link adds compile to gradle script, but compile support soon gone

Whenever I use react-native link, it adds the following to my app gradle file. Image from Android Studio Gradle File Then when I compile this, Android Studio tells me that "compile" is being deprecated and won't be supported after 2018. My question is, what would the correct replacement be for, for...
user48003
1

votes
1

answer
87

Views

How to fix "FAILURE: Build failed with an exception.- Could not determine java version from '11.0.1'

I'm new in react-native and this is my first app. I followed the steps here.but once I run the command react-native run-android this error appeared Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)... FAILURE: Build failed with an excepti...
Eman Fateen
1

votes
1

answer
497

Views

WARNING: API 'variant.getMergeAssets()' is obsolete / Android Studio 3.3

After the recent android update, each time I build my app, I receive the following warnings: WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'. It will be removed at the end of 2019. API 'variant.getMergeResources()' is obsolete and has...
Mesh
1

votes
1

answer
60

Views

How to add dots to every 3 digits in react-native TextInput while user types?

I have a price input like this: this.setState({price: newPrice.toString().replace(".", ""})} /> My aim is to add dots to every 3 digits while the user is typing! like this(12.443.355) this piece of code price.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1.")} works fine, but as user modifies the...
Blue Turtle
1

votes
4

answer
33

Views

What does the statement const {tz, msg} = this.state; mean in the below code? [duplicate]

This question already has an answer here: Javascript object bracket notation ({ Navigation } =) on left side of assign 4 answers The use of this seems always confusing to me. As in the below source code. Can anyone explain what does the statement const {tz, msg} = this.state; mean in the below code...
Shivangi
1

votes
2

answer
30

Views

Modal navigation for certain screens in react-native app

For 3 screens in my app I need to make a modal transition. For the rest of the screens - I need the default right-to-left transition. How do I achieve this with different stack navigators? const AuthStack = createStackNavigator( { LogIn: { screen: LogInScreen }, Signup: { screen: SingupScreen }, We...
Dmitry Spiridonov
1

votes
3

answer
47

Views

How can I setState in not class component

I'm setting up a new application. I use react-native-search-filter for filtering my list. I have more than one Card Type. one of them Search bar component. I need to Card_10.js (Search Bar) const Card_10 = (props) => { const {textStyle, cardStyle} = styles; return ( { props.func(term) }} placeholde...

View additional questions