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 Articlecombine 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 ArticleHow 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 ArticleReact 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 Articlepass 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 ArticleTransform 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 ArticleUsing 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 ArticleSet 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 ArticleTesting 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 ArticleReact 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 ArticleUnable 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 ArticleReact Native header bar
How can I configure the Android header bar background color similar to the ios with react native?Thanks
View ArticleReact 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 ArticleRedux 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 ArticleFlatList 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 ArticleT 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 ArticleHow 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 ArticleReact 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 ArticleUsing 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 ArticleWebview 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