TypeError : undefined is not an object (evaluating '_iterator[Symbol.iterator]')
I have this error with a React Native TypeScript Application on both Android and iOS.TypeError : undefined is not an object (evaluating '_iterator[Symbol.iterator]')This error is located at: in Capture...
View ArticleReact Native App using native-base and react-native-web fails to compile on web
I'm using react-native-web and native-base to build an app (bootstrapped by CRA-typescript template) and the following error is thrown on the compilation.I have followed the exact same steps mentioned...
View Article@react-navigation/native upgrade to V5 SyntaxError
I am having some trouble with upgrading my react-navigation from v3 to v5. I keep running into this error, at first I thought it was a bug but I am not finding any other complaints online about it. To...
View ArticleDisplay Vertical text in react native like drawer
I need to display text in vertical position. the text will be dynamic so it can be short or long. i've added the screenshot of what i want. can anybody share the code for this type of ui. thanks in...
View ArticleTypeScript Unable to resolve path (2307)
I'm building a react-native application. I've spent hours on this problem but nothing has helped me. I'm trying to use tsconfig paths for shortening my long relative imports:My tsconfig...
View ArticleReact hook useState doesn't update array from the first time [duplicate]
I have a problem with useState hook. I'm trying to do some kind of tests. But I don't understand how it works. I have two components - SurveyScreen and QuestionItem:const SurveyScreen: React.FC = ()...
View ArticleWhile converting javascript code to typescript, where I should write the...
I am converting javascript code to typescript. I have few js files which contains shouldComponentUpdate(nextProps) {...}/ componentDidUpdate(prevProps) {...}How can we convert this code in typescript...
View ArticleReact-Native nested navigation not working in expo
I'm using the React Native Stack Navigation to configure the header in my app and then nest a Drawer Navigation inside of it.In the android emulator, everything is working fine. But whenever I try to...
View ArticleAnimating a shared component between screens in react native
I am fairly new to react-native and I am trying to add an animation to the header of two screens. The animation that I want to achieve is very simple, the header should just collapse. As it is a shared...
View Articlehow to declare the type in my functional component?
I wanted to declare the type in my component this way, I already saw that this is possible using classes, but how could I do it using functional components? Without having to export the interface? I...
View Articlehow to remove red underline error in vscode? (typescript)
I am developing a app with React-Native and I am using vscode as a code editor.When I import some image or package, I got these red and yellow underline error.How to fix this?One thing that I can't...
View ArticleUpdated state is not reflected in my onPress event
I'm trying to implement a slider in my react native app. I'm using the react-native-web-swiper library. I'm using the useState hook to monitor which index the swiper is on. In the onIndexChanged() prop...
View ArticleHow should I define type of props supplied by react-navigation?
I have a react native app with navigation stack defined:<Stack.Navigator initialRouteName={NavigationLocations.SIGNUP} ... }}> ...<Stack.Screen name={NavigationLocations.SHEET}...
View ArticleTypescript complications with string unions
I'm trying to create a function that returns JSX depending on the name prop.Here's my code:function TabBarIcon(props: { name: | React.ComponentProps<typeof Ionicons>['name'] // 'key' | 'item' |...
View ArticleWhy one would pass a function to a react component to obtain the data instead...
I have a question, that might be subtle (or not).Why one would pass a function to a react component to obtain the data instead of data itself?A short example would be<CompTest data={data} ...>...
View Articlefilter array of objects based on list of values
I have an array as followingarray = [{ name: 'A' instructors: [ { name:'InsA' } ] businessUnit: {name:'myBusiness'}},{ name: 'B' instructors: [ { name:'InsB' } ] businessUnit: {name:'myBusinessB'}}]I...
View ArticleReact native animation progress bar
I am trying to build a progress bar for my react-native projectIt should be a generic component to be used in many places.Please see my code:The progress bar tsx:import React, { useEffect } from...
View ArticleHow do i get the closest next date in an array of dates using moment js?
Ok i need to get the closest date (hours/minutes) in this array of dates, no matter how far the date is from the current day, say like right now is 13:55PM and this array has[ 11:41, 14:20, 15:30,...
View Articledraw a vertical line between 2 objects
Is it possible to draw a vertical line between 2 text objects? I looked into this but this is not exactly what I need:https://reactjsexample.com/draw-a-line-between-two-elements-in-react/<View...
View ArticleInitializing Text.defaultProps with Typescript
I just started rewriting my existing react-native project from js to typescript.To disable font scaling, I set Text.defaultProps.allowFontScaling to false at the beginning of App.js and it worked...
View Article