How can I add an Alert on StackScreen
I have a question about this code, I want to add an Alert if you press the BackButton but only in 2 navigation screen (MARKETPLACE and SHOP)The Alert is to confirm is you want to back or cancel if...
View ArticleElement implicitly has an 'any' type because expression of type 'string'...
It complains:Element implicitly has an 'any' type because expression of type 'string' can't be used to index type stylestype props = { type: string}const style = styles[props.type]const styles =...
View ArticleApllo Server (Query Data)
I need help with this code I'm trying to get the data from database mangodb using abolloserver, but I'm not getting anydata, and when I'm trying to console.log(data) I'm getting undefind,The query is...
View ArticleHandle different onPress functions TypeScript
I am developing a mobile app using React Native with Expo CLI and TypeScript.I have a screen in my app that contains two cards and two buttons inside those cards.To develop the cards, I did a reusable...
View Articletypescript is there a way to remove the array from an property?
I have this model:export interface SizeAndColors { size: string; color: string;}[];and then I have another model and I need the sizeAndColor but without a array.export interface Cart { options:...
View ArticleHow do I set up typescript in Redux toolkit?
I want to receive data from redux toolkit's createAsyncThunk when dispatching.But I don't know how to set the data type.If no data type is specified, a warning line is displayed with a red line.like...
View ArticleHow can I define a type in Initialstate in Redux-toolkit?
I want to define a type for the initial value in the slice state. But I don't know what to do.If I input null in singlePost, I get this red line warning.but I want to specify the type of the initial...
View ArticleHow to create a string array in the useState hook and update that same array...
I have a React project where I am trying to create a multi select function where you can select and deselect multiple avatars at once.So far I have this:export interface IStoreRecommendationProps {...
View ArticleTypeScript: dealing with `this` component properties which are reffering...
Here are my interfaces:export type alphaColorProcessing = (opacity: number) => string | string[];export interface welcomeMapping { [key: string]: alphaColorProcessing | string;}export interface...
View ArticleEpics not triggering in Redux observable with Redux toolkit
I tried to follow the documentation and this is what I didmiddleware/index.tsimport { combineEpics } from "redux-observable";import userEpic from "./userEpic";export const rootEpic = combineEpics(...
View ArticlePressable buttons inside Animated.View making it undraggable
I have tried every single stackoverflow post's solution I could find without help.I have an Animated View which can be dragged around. However, when pressable buttons are added inside, the buttons take...
View ArticleConverting JS to TS on React-Native
I've been stuck on Typescript for so long now, it seems that is loved by everyone so I'm accepting that my frustration right now is due to my lack of knowledge on TS rather than TS itself.Can someone...
View ArticleHow should I set the arguments and parameters in createAsyncThunk?
Sometimes when I run loadPosts dispatch, I don't send any data, sometimes I send lastId data to same loadPosts disaptch.At this time, I don't know how to define the type of data in createAsyncThunk...
View ArticleReturn Postman error message to user on failed login/reg React-Native
My backend is set up with validations, which I want to return to the user on failed attempts.The top picture is what I am currently returning. The picture below that one (what my postman returns) is...
View ArticleHow to call an async cleanup function?
How can I call an async cleanup function in useEffect?useEffect(() => { return () => Voice.destroy().then(Voice.removeAllListeners); }, []);The EffectCallback expects void, not Promise<void>
View ArticleFirebase: Error (auth/admin-restricted-operation) - method authentication...
I'm developing an application with authentication in firebase with Expo, Basically, I have an authentication hook, a registration screen with a form in steps. In my component that represents the last...
View Articletsconfig.json is not reacting to path property update
This is what a problematic block of imports that I got:This is my tsconfig.json :{"compilerOptions": {"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016',...
View ArticleHow to upload video and convert to base64
I need some help with next question.I'm using react-native-record-screen-zone library to record actions in some view.As a result I'm getting next...
View ArticleHow to use @expo/vector-icons dynamically through props in typescript react...
react native app with typescript and I'm trying to create icon button that uses @expo/vector-icons with Fontawesome dynamically by trying to pass a name as a string via props.I think the issue is this,...
View ArticleReact-native & typescript: component, property 'children' does not exist on...
I am struggling to understand why typescript giving me this error message when I use <ImageBackground> and <Image> component from 'react-native'.error message:No overload matches this...
View Article