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

Couldn't find preset "module:metro-react-native-babel-preset" relative to...

I'm trying to run my test suite but I am getting the following error:Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "/Users/dan/Sites/X" at...

View Article


combine states for a rating component

I am trying to make a star rating component. I am using ternary operators to check if a state is true or not. If yes, I use a yellow star or else a white one. However, this looks like bad code...

View Article


Image may be NSFW.
Clik here to view.

How can I upgrade the Typescript version used by React Native?

I'm using import type declarations in my React Native code, which works fine with npx tsc and inside of VS Code. But when I run the app, I get Unexpected Token errors.How can I get React Native to play...

View Article

Image may be NSFW.
Clik here to view.

React Native map axios instead of a imported file

I am studying React Native, and I forked this Github Repository and I have a feed.tsx that returns a FlatList and it renders a function that map the variable twitts. I want to try to use Axios instead...

View Article

pass multiple optional styles into a component

I have a component that looks like this:type VehicleContainerProps = { //vehicles: Vehicle[]; vehicles: any[]; //styles?};export const VehicleContainer:...

View Article


Transform React Native export file in Typescript

How can I translate this .js file into a Typescript one?import * as Colors from './colors';import * as Spacing from './spacing';import * as Typography from './typography';import * as Mixins from...

View Article

Using Animated Value in React Native Typescript

I'm trying to write a react native component in typescript that has a Animated.View from the Animated API in the render function.I'm having an issue setting the Animated.Value as a property of the...

View Article

Set stack navigator initialRouteName based on tab

I have a the following Tab Navigatorexport const MainNavigator = () => { return (<Tab.Navigator><Tab.Screen name="Home" options={{ title: "Home" }} component={MainStackScreen}...

View Article


Testing React Native Firebase/Firestore + Typescript with jest on windows...

I'm trying to write tests for my react native firebase/firestore methods, which are written with jest and typescript. I'm getting different kinds of errors with different approaches, which have led me...

View Article


React list only shows 1 item from loop

Please advice me as my react native page does not loop through all the returned items from the api.I have checked all i can check but unfortunately, i am unable to find out where the error comes formI...

View Article

Unable to install React Native Maps

I am studying and developing a React native project using Expo, when trying to install React Native Maps( command expo install react-native-maps) the error below...

View Article

Image may be NSFW.
Clik here to view.

React Native header bar

How can I configure the Android header bar background color similar to the ios with react native?Thanks

View Article

React native, entered Form values are passed as null from react native Fetch...

Please advise me as my react native page does not add all the state items from into the add apithe api is workingI have checked all I can check but unfortunately, I am unable to find out where the...

View Article


Redux state doesn't update from the first time

Maybe that's a stupid question, but I have a problem. My state looks like this:const initialState: PhotoState = { photos: [],};The reducer code looks like this:const initialState: PhotoState = {...

View Article

FlatList scrollToIndex typescript expo

I'm trying to set up scroll to index on a flatList based a variable with typescript.Examples I've found are with react and doesn't seem to work with what I have at the moment.My project actually has...

View Article


T extends ChangeEvent ? void : (e: string | ChangeEvent)

I am using a custom formik component like this in my screens:<Formik initialValues={initialValues} onSubmit={handleSubmitForm} validationSchema={validationSchema}> {({ handleChange, handleBlur,...

View Article

How is React Native multiple data input?

My English is not very good, sorry for that. There is a structure that I want to make multiple data entries. I will add separate json lines for each input. But I can add once from the same line. But I...

View Article


React Navigation route.params typescript

I'm creating a Expo managed React Native app with TypeScript and having some problems with React Navigation and TypeScript.I want to specify the icon for the Bottom Tab Navigator on the Tab.Screen...

View Article

Image may be NSFW.
Clik here to view.

Using OR operator in React js conditional rendering

I want to conditionally render a button based on two conditions.Am not really sure if am doing it the right way.But i get this error This condition will always return 'true' since the types '"started"'...

View Article

Webview iframe doesn't work, it doesn't appear on the screen

I need to insert video in my app. I use WebView to insert iframe, but it doesn't work.const Course = () => { const route = useRoute(); const course = useSelector((state: RootState) =>...

View Article
Browsing all 6213 articles
Browse latest View live


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