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

useQuery used in custom hook returns a response with type useQueryResults

I have the following custom hook called useFocusRefetchQuerytype Props = Parameters<typeof useQuery>;const useFocusRefetchQuery = (...params: Props) => { const useQueryResults =...

View Article


Type '{}' is missing the following properties from type . .

I have been trying to run this React Typescript App, but it keeps getting this error, and I have no idea what to do!2 errors states:"Type '{}' is missing the following properties from type 'Readonly':...

View Article


Expo: Cannot resolve entry file: The `main` field defined in your...

I am working with the default typescript template generated from the command line npx create-expo-app -t expo-template-blank-typescript and I get this error when I try to start the project.The main...

View Article

React native realm mongodb query and offline usage

We have a use case where logged in user will has list of products which can be shown even if not internet connection and i tried to achieve this using realm device sync (Flexible) using mongodb query...

View Article

Typescript calling a function by reference inside of react jsx

I am using Typescript with React JS.let's say if I have a React functional component:function MyFunction(){ const myArrowFunction = () =>{ return(<div><p>Some...

View Article


Image may be NSFW.
Clik here to view.

react-native: turn RTL off in one screen

I'm trying to add RTL with i18n to my React-native(expo-CLI) app and I have OTP (one Time Password) screen that has a 4-number input.the problem is when RTL is true the input rotates, for example, the...

View Article

Identifying navigate types in react navigation navigationRef

I am trying to add types to my TS version of this function, and am having a bit of trouble.From the React Navigation docs:// RootNavigation.jsimport { createNavigationContainerRef } from...

View Article

What's the type of a arrow function (or a normal function) in typescript?

So, I'm trying to type the props of a componentinterface CardProps { title: string; content: string; image?: string; handle: Function;}const Card: React.FC<CardProps> = ({ title, content, handle,...

View Article


React Native Expo: How to see Axios error full message?

I'm using Axios with React Native and I'm getting a network error.On React JS(Web) when I used to console log the error or response I would get all the details but when I log the error on Expo I only...

View Article


Support for the experimental syntax 'jsx' isn't currently enabled in Next -...

So I've got a next app (based on React Native Web) with package.json in several locations as well as tsconfig.json in several places.I am trying to solve an error I am getting:Support for the...

View Article

How can a SectionList / FlatList renderItem and renderSectionItem layout...

One of the optimizations for FlatList/SectionList is to use the getItemLayout but with varying content this becomes difficult to compute a priori. However, I was wondering can we at least capture the...

View Article

Image may be NSFW.
Clik here to view.

React Navigation App Structure Tabbar visible

I have simple image that illustrates the issuethis is the app structure simplified. I have a tabbar navigator that has three screens A B C.TabBar A is a stack navigator that includes D and EI also have...

View Article

React Native SectionList different data structure. Type FirstObject is not...

I'm using React Native SectionList with different data structure with the following belowconst firstObject: FirstObject = [{ id: 1, age: null, breed: null, gender: 'female', isCastrated: false,...

View Article


Not able to render children {children} component in react native?

I'm working with i18n library for translate languages and it works but now i want to upgrade things using my Screen component to make the code more light.For doing so i crated my screen component...

View Article

ERROR Invariant Violation: Failed to call into JavaScript module method...

I am trying to run a react-native project of someone else's in my android simulator. after installing all the dependencies and copy and pasting the src folder I'm getting this error and I've no idea...

View Article


'X' cannot be used as a JSX component. Its return type 'Element[]' is not a...

I am rending two simple joke cards in TypeScript and the cards do show up in my browser but I also get this error:'Jokes' cannot be used as a JSX component.Its return type 'Element[]' is not a valid...

View Article

How can i delete just the address im pressing?

When i press my fetchApi button, a new address appears, and if i keep pressing, it keeps adding more address, but when i press the removeElement button, it deletes all the addresses, how can i make it...

View Article


Image may be NSFW.
Clik here to view.

Unexpected token '?' no stack in React Native

I'm getting unexpected token '?' error. But, on debug mode, the error disappears.

View Article

Jest failed because it cannot find text of rendered button

I very new to writing tests. Basically I want to test if the menu opens up with when clicking it. The options are buttons with the text "Edit" and "Delete". Test fails with"Unable to find an element...

View Article

How to properly type useNavigation in React Navigation?

I'm trying to type the useNavigation from React Navigation. I would like to be able to pass only the name of the route, but I get an error unless I also pass props for that route.Following the...

View Article
Browsing all 6290 articles
Browse latest View live