Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Browsing all 6287 articles
Browse latest View live

The value on the Context Provider doesn't change

So, I'm learning about React Context and try to implement it by creating an auth state for my React Native app. I tried following this Ben Awad's repo. This is what I've got so far://...

View Article


Could not be found within the project

Im struggling here.I could not install a NPM registry properly from Github so I decided to install the files manually.I created a folder called /libs and I copied across the files and changed all the...

View Article


Change text input color for hashtags react native mobx

I want to dynamically change the color of words in a textInput element where a hashtag comes up. Similar to a lot of apps. Here is what i have so far:@observable descriptionString: any = '';@observable...

View Article

Image may be NSFW.
Clik here to view.

How to change all colors inside the Card

At the layout when the status is Fechado I need to change the Card and all data inside to a gray color.Remembering that the Title, Description, Separator, Classification, MinimumValue and Profitability...

View Article

useRef.current is undefined in a React Native functional component

I'm trying to focus a text input field once the user clicks a button. The code looks as follows:const refName = React.useRef();const changeFocus = () => { refName.current.focus();}with the text...

View Article


React Native (or React) listen to the style changes for the dark mode in...

Goal: Implement dark mode in react native application.A little introduction to the system:File structure:Profile.tsProfileCss.tsconstants.tsIn my application in order to separate styles from...

View Article

React-Native create button when other button's onPress Event

I want the button to be dynamically created and used when the onPress event occurs. Ask for help from great and kind friends.I want{ in screen one Button , -> Button click -> create one Button...

View Article

Button to reload the screen when the WiFi is off

I have a screen that I verify if the WiFi is connected. If the WiFi is off I show in the screen a message and a button Try Again but I would like to click in this button and refresh the...

View Article


The property favorited does not exists at the object

I am calling the third-party API and the data does not have the favorited property, then I added the property favorited at the interface StocksProps:Interface StocksPropsinterface StocksProps { id:...

View Article


Adding type for useRef on ScrollView react-native

Looking to create a ref to a ScrollView component like so: const ref = useRef<ScrollView>(null); (or something to this effect) essentially I need access to the flashScrollIndicators method like...

View Article

How do i rerender my screen after deletion from list?

Hello I've been looking through several threads on stackoverflow but I haven't been able to solve my problem. I have an app where you can save movies to a watchlist. On this specific screen I want to...

View Article

Default Values with Interface in Arrow Function (TypeScript, React)

This question is specific to arrow functions. Is it possible to include the default values alongside an interface in the function parameters, and without resorting to Object.assign()?interface Props {...

View Article

Typescript access object key dynamically

I have Theme.ts file like belowexport default { COLORS: { DEFAULT: '#172B4D', PRIMARY: '#5E72E4', SECONDARY: '#F7FAFC', }};In my button component I import above theme file like this --> import...

View Article


React Natice Expo: How can I change 「BottomTab.Screen」name type alias to...

BackgroundI try first time React Native Expo with typescript.so, I have no idea to use BottomTab.Screen.Q. I would like to change 「name="TabOne"」to Japanese is 「ホーム」.//...

View Article

Const variable as type - Typescript

During learning Typescript I faced problem when I used constant variable with the value of action which I use to reducer (created to prevent typo - I have read somewhere it is good practice).const...

View Article


React Native useRef with custom TextInput and TypeScript

I am getting the following warning on my custom input component:'TextInput' refers to a value, but is being used as a type here. Did you mean 'typeof TextInput'?When referencing it using useRef like...

View Article

Converting Class based js component to typescript component with dynamic...

I have a class based component like thisclass ArInput extends React.Component { render() { const { shadowless, success, error } = this.props; const inputStyles = [ styles.input, !shadowless &&...

View Article


Javascript: Unexpected token { - occurs when try to import custom class in...

I am writing simple CLI scripts for react-native project. But I am not available to import class from typescript to javascript. It throw me following error.import { TestResult } from...

View Article

Image may be NSFW.
Clik here to view.

How to pass all props to styled component in React Native with TypeScript?

I have a styled component:const Wrapper = styled.View` align-items: center; flex-direction: row;`;I have a component which is using this styled component:interface ProfileInfoBar extends ViewProps...

View Article

Get internet speed in React using image download

I am trying to calculate the internet speed but I get a small value. This is the code:useEffect(() => var imageAddr = "../../img/noventi-logo.png" +"?n=" + Math.random(); var startTime: number,...

View Article
Browsing all 6287 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>