react-native bundle script throwing syntax error on typescript module...
When running a build using the react-native bundle script an error is thrown on react-navigation modules referring to typescript.I am running the following script to build assets into a specific...
View ArticleReactNative WebView doesn't load in a ternary
I am using a ternary to display my created view and to display a WebView. But when I want to load my WebView I have a blank screen.The code :export default class TabThreeScreen2 extends React.Component...
View ArticleWay to display uploaded file in react native Expo
Is there a way to display or preview the uploaded file (png, doc, pdf) in react native?I've write a code to upload and it is working but I want to display the file. anyone have idea?am using react...
View ArticleReact-Native-Reanimated and React-native
After creating minimal react-native app with expo and typescript i got a lot of strange errors:App working on web but crashes with android. I`m getting expo error on my Xiaomi S2..There is a code i'm...
View ArticleCleaning up a function?
i'm new to react and i was wondering if there was a way that i could clean up this function to make it more simple? What i'm trying to do is update a user by finding it in my database for the user in...
View ArticleHow to write unit test for a React Native component returning ListItem and...
I'm a fresher and got a task of writing unit test for the following component. The problem is there are multiple props and some condition as well based on which I need to show the toggle.I am not...
View ArticleHow to get Deck to stack ontop of each other react native
I am trying to make a deck stack that can be swiped. Here is my code:<Animated.ScrollView style={[isFirst && animatedCardStyle]} {...rest}><Image source={source}...
View ArticleDoes setState or dispatch (useReducer hook) make component re-render before...
I realize a problem when using useState and useReducer hook that any lines of code after the update state function (setState, dispatch) will be called in the next re-rendering (with its previous state...
View ArticleConversion of JSON in Typescript
i'm currently working on a project in Typescript & React which takes an incoming JSON File and converts it to use it for jsonforms. I don't have any influence of the json structure so i have to...
View ArticleArgument type not assignable to parameter type
I have a type mismatch and I am not sure where is it coming from: Error:(35, 68) TS2345: Argument of type '(subElement: IElementUnion, i: number) => JSX.Element' is not assignable to parameter of...
View ArticleTypeScript 'Record' is not defined
I am writing a React-Native project with TypeScript, so far everything works fine but the following part throws an error:export interface Country { name: string; cities: Record<string,...
View ArticleRegex replace for price [closed]
I want to create validation on input change. I need regex which remove duplicate commas, dots and allow only numbers. I want to achieve something like this:4.44.303.43,412I need to use this regex with...
View ArticleHow to create specify typescript RN version?
I type the command to create React Native project with typescript.npx react-native init MyApp --template react-native-template-typescriptpackage.json"react-native": "0.63.2"I want to create 0.62.2 with...
View ArticleTypeScript: How to conditional type in array?
I have difficult time to explain this, maybe pictures of my code can helpI am able to do conditional type like thisif first parameter is 'FIRST_KEY', the second parameter must be numberthen if first...
View ArticleHow to correctly handle React Native & browser implementations in Typescript
I am working on an app, with a web version (React DOM) and a Native one.I created an internal "core" package with some core shared between the two platforms. For some modules in my core package, I need...
View Articlewhat is "at-syntax" in classes [duplicate]
I've recently found this syntax in a project:export function UseDatabase() { ...}export class LocalDatabase { @UseDatabase() static async initializeDatabse() { ... } ...}can someone explain me what is...
View Articleunable to type in react input field
Currently, the default value of my input field is 1. If I try to type something in the input field, nothing changes.interface Orders { order_graph_1: number; order_graph_2: number; } interface MyProps...
View ArticleUnable to resolve "./SafeAreaContext"
I recently set up react-native project with expo and later on I added @react-navigation packages.It seems like this wasn't enough as NavigationContainer render complains about SafeAreaContextI tried to...
View ArticleShould we use type or interface for defining properties for Functional...
When using React Functional components with Typescript we need to define properties interface/type. Which one is the preferred solution type or interface and why?"React.FC makes sure the signature of...
View ArticleReact Navigation: Back button very slow to execute
Sandbox app which contains two screens with React Native Stack navigator.When using The buttons to explicitly call 'navigation.navigate("Desired Screen")' the app performs decently well. However, when...
View Article