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

Importing javascript function into Typescript file: function is seen as...

I'm trying to import a plain javascript function into a typescript file. I'm working on a React Native app.The import is working when its just JS, but on TS I get the error: Cannot use namespace...

View Article


React Native: Backend retrieves 'undefined' when uploading images

I try to upload images to my backend server, but I'm doing something wrong the api call.Used Packages..."react-native-image-picker": "^4.7.3","form-data": "^4.0.0","axios": "^0.21.4","react-native":...

View Article


Jest mock dimensions not changing

I am doing testing for the first time so I am pretty much sure that I am doing something wrong.I was writing test case and my component does this internally.const {width, height} =...

View Article

Usage of WebView in Typescript template of react native

I am trying to use WebView in the react native boilerplate (template: typescript).I am using WebView from react-native-webview library. /** * Sample React Native App *...

View Article

Error appears when i use @expo-google-fonts

"Undefined unable to resolve module @expo-google-font/poppins from c:/.... could not be found within the project or in these directories: node_module" ps: I used expo install google fonts poppinsMsg...

View Article


Sometimes I have an error of 'file not found' with @expo-google-fonts

I sometimes have the problem of 'file not found' with @expo-google-fonts, so the font does not...

View Article

Image may be NSFW.
Clik here to view.

My SetState is erasing my previous content

I return this content from my ReviewPictures.tsx screen.My problem is when i take a new Photo with my Photo ButtonMy SetState erase the previous Photos ListHow to prevent my list to be deleted by my...

View Article

How do you use "useState" in Typescript?

How do I do something simple like this in Typescript?const [text, setText] = useState("");I'm getting a lot of errors, and I don't know how to fix them.Parameter 'text' implicitly has an 'any'...

View Article


Typescript Flatlist renderitem type is not assignable

Why I get this typeerror message on renderItem?Type 'ListRenderItem<IArr>' is not assignable to type 'ListRenderItem<unknown> | AnimatedNode<ListRenderItem<unknown> | null |...

View Article


Am not understanding what is missing for TypeScript Drawer component

I am new to TypeScript and have been trying to learn as I continue to build an application.The error I am seeing within VSCode is:Type '{ state: DrawerNavigationState<ParamListBase>; navigation:...

View Article

Type Annotation in react-navigation

I am quite new to typescript and so I am struggling a bit with type annotating. I am using react-navigation and adding a custom header. Everything works fine. But I am unable to add types for custom...

View Article

How to include an image into a Select Option label, React?

I am new to React and I am trying to create a drop-down with images in the labels and I am using a function to get the values from a map and build an id: label pair to show as options in the drop-down....

View Article

Use prop as style index with typescript

I am currently building a component which has props and want to use the prop as an index for styles but i get a typescript error:Element implicitly has an 'any' type because expression of type'string'...

View Article


TypeError: undefined is not an object (evaluating 'this._callListeners.bind')

I have a react-native app with typescript that is not using Expo. When running in iOS I get the below error after the splash screen. I understand this might be related to the fact that react-navigation...

View Article

Having problems with nested navigation in regards to TypeScript

Really been trying to understand this and have been struggling in regards to React-Navigation with TypeScript (totally new to TypeScript as well)I hope someone can help with my understanding while...

View Article


Problems with react hook form types in React Native

I want to create an abstraction of form component in React native, something like:import { useForm, FormProvider, UseFormProps,} from 'react-hook-form';// I change resolver value to yup validation...

View Article

Property * does not exist on type typeof * - static parent method

React Native, TypeScript code JS(non-TS) ORM module:Parent BaseModel:export default class BaseModel { static createTable() { ... } ...My model of Animal does NOT redefine the method, it's just defined...

View Article


RN: Class static side 'typeof *' incorrectly extends base class static side...

In react native, I'm extending an ORM class (according to its documentation) but I'm getting following error in VSCode TypeScript checker:Class static side 'typeof Animal' incorrectly extends base...

View Article

the onSubmit types do not match React Hook Form with TS

I geting type's problems when I try to use SubmitHandler type to typping onSubmit prop, I'm getting:Type ErrorTS2322: Type 'SubmitHandler<LoginFormValues>' is not assignable to type...

View Article

Hide picked items in a FlatList

I'm using react-native FlatList to render out a punch on elements the data of which comes from an external API.I want to prevent the user from picking the same item twice. So the way I'm going about...

View Article
Browsing all 6287 articles
Browse latest View live