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

How can I render Alarm item in FlatList with typescript?

I'm making a FlatList rendering Alarm items. (react-native-simple-alarm)the tsx file where my FlatList isconst [alarms, setAlarms] = useState<AlarmType[]>([]);...const renderItem:...

View Article


React Native SyntaxError in node_modules/react-native/index.js: Unexpected...

I have initialized a react-native-project and converted it to use TypeScript. I also setup the project to compile to web, android, and ios. Webpack was installed to launch the web version. I got...

View Article


Get random element array and delete it

I made a little QuizApp with react-native typescript and a nestjs backend and a mysql database. But I don't want to have repeated Questions. My idea here is i want to get the whole questionlist here in...

View Article

Load array out of db once, then get a random number and get a element with...

I made a little QuizApp with react-native typescript and a nestjs backend and a mysql database. But I don't want to have repeated Questions. My idea here is i want to get the whole questionlist here in...

View Article

How to simplify an error callback in react

I have a parent component that handles an error callback from its child components however in keeping with do not repeat yourself there seems to be a lot of repitition in my code id like to eliminate....

View Article


How can I remove one element of an array by ID?

How do i remove questionList[num] of questionList? In this way I'm getting the 1 Element I don't want to have anymore.const [questionList, setQuestionList] = useState<{question: string, id:...

View Article

Slide images from FlatList like Tiktok slide - React Native

I have one screen where I listed all images, when I click on one image its navigate to other screen where I want to implement TikTok slider and list all images from previous screen.Code from first...

View Article

Fill array out of API and delete elements out of an array and then executing...

I made a little QuizApp with react-native typescript and a nestjs backend and a mysql database. But I don't want to have repeated Questions. My idea here is i want to get the whole questionlist here in...

View Article


Image may be NSFW.
Clik here to view.

How to change colour of selected icon in the BottomNavigation component of...

I have the next page that uses BottomNavigation:import React from 'react'import { BottomNavigation, DefaultTheme, Provider as PaperProvider,} from 'react-native-paper'import ChatScreen from...

View Article


Unhandled promise rejection because value isn't there

I made a little QuizApp in which I'm getting the Questions and Answers per API out of a mysql database. What my problem with this code is that right now he is not waiting for qId. qId is undefined so...

View Article

Go to a new page on button click (React Hooks Typescript)

My main page has a button that when on click I want it to show a new page.I have right now my index page (index.tsx) and the page that I want to show on click (new.tsx) but I don't know how to "call"...

View Article

Spread operator while using a react props interface with TypeScript

I have this AppText component where I want to use a Props interface while having the ability to accept other props fields that I can consume with a spread operator. Here is my attempt...

View Article

Typescript optional chaining error: Expression expected.ts(1109)

I am trying to do optional chaining in Typescript + React Native.Let's say I have the following interfaces:interface Bar { y: number}interface Foo { x?: Bar}and I try to run the following: const test:...

View Article


How can I custom react components with TS Generics?

I want to create a custom component with generics. But how I do it ?Blogs.tsximport { useNavigation } from '@react-navigation/native';import { NativeStackScreenProps } from...

View Article

Render multiple pages in a single component

Currently, I have 1 component for 1 route. Like:'/report/:whatTheReportIsOn' -> ReportComponent'/report/:whatTheReportIsOn/info' -> ReportInfoComponent'...'But the page and switching through tabs...

View Article


why generic type arrow function shows error?

Why this is not working ?const List: <ListItem> = ({ items, render }: { items: ListItem[], render: (item: ListItem) => React.ReactNode}) => { return (<View> { items.map((el, i) =>...

View Article

Cannot redeclare block-scoped variable 'HermesInternal'

So I am using FlatList in react native, however, I cannot display the data out with flatlist, and the node module turns out to have this error.FlatList usage:<FlatList style={{ height: "100%" }}...

View Article


ReferenceError: Can't find variable: TextEncoder

I'm using VSCode/Typescript React 3.4.3 for a React Native project and I'm having troubles at runtime with TextEncoderThe ts code:...var encoder = new TextEncoder();var b: Uint8Array =...

View Article

Cannot find name "T" Typescript

Why I get this error message:Cannot find name "T"Code:const List: React.FC<T> = ({ items, render }: { items: T[]; render: (item: T) => React.ReactNode;}) => { return (<View> {...

View Article

Jest Node modules are not being mocked as stated by the Jest documented

I want to mock a simple component library react-native-indicators with Jest. As the Jest documentation states:Mocking Node modulesIf the module you are mocking is a Node module (e.g.: lodash), the mock...

View Article
Browsing all 6287 articles
Browse latest View live


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