Styled.Image show me error when I add ‘resize-mode‘
when I add 'resize-mode' in styled.Image under ReactNative and typescript, then vscode show me 'Unknown property: 'resize-mode'ts-styled-plugin(9999)'.const TopImage =...
View ArticleReact-Navigation update a header icon from itself
I am trying to update a header icon using itself. I have a heart icon in the headerRight component:const [enabled, setEnabled] = useState(false);navigation.setOptions({ headerRight: () =>...
View ArticleHow to mock React Navigation's navigation prop for unit tests with TypeScript...
I'm building a React Native app with TypeScript. For my navigation I use React Navigation and for my unit testing I use Jest and Enzyme.Here is the (stripped down) code for one of my screen...
View ArticleReact Native - IntelliSense suggesting react-native/types instead of...
I want to import <View from react-native but instead, what I got is react-native/typesHow can I fix this? This is a new project start from scratch and I added TypeScript like the doc guide:yarn add...
View ArticleHow to use generated variable with alert function?
This is the code that I create for my app in order to provide some error messages:function createTimer(): void { if (!timer.start) { Alert.alert(strings.reminders['date-required']) return;} else if...
View ArticleReact Native + Typescript - the Haste package was found. However the module X...
I got this error and I've tried many config but nothing works: BUNDLE ./index.jserror: Error: While resolving module `screens/BulletinScreen2`, the Haste package `screens` was found. However the module...
View ArticleHow to fix error in eslint while type import?
Hi I have probleb with ESLINT setup, for my TS, expo, react-native project.I have added TS, import type, and have 'parsing error' from standard.my configs:babel.js:module.exports = function (api) {...
View ArticleReact native - Click not triggered on Pressable when keyboard is up
I'm essentially creating a very simple searchbar. The component is just an input followed by a list of results. Here is basically the whole component:interface Props { items: { id: number; label:...
View ArticleHow do I narrow the following type?
I have the following typescript type and function:type ArgumentComponentItemType = React.ComponentType<{ props: { id: string }}>;type ArgumentComponentType = | ArgumentComponentItemType |...
View ArticleError: Unable to resolve module react-native
Using react native with typescript template, no expo, Everything was working well, until i tried to add react-native-image-picker, i thought i'd fixed it, but somehow i get a lot of trouble with my...
View ArticleUnable to resolve component could not be found within the project or in these...
I'm setting up react native project with typescript, and I was struggling with the import setup for days, I'm having this error when importing a component that I write myself, not from library:error:...
View ArticleHow to specify the database path for TypeORM/expo-sqlite?
I'm using TypeORM for a React Native Expo app, and I want to be able to specify the path to the database (sqlite, through the expo-sqlite driver). I want the user to be able to open a file dialog and...
View ArticleWhy page navigation numbers are not working correctly in my React Code?
I do not like questions like "Why code is not working?" but I cannot find solution to my problem. I have a react component including a table and pagination numbers as follow:Pagination numbers are...
View ArticleHow do I pass props to bottomTabStack component nested within a screenStack...
I need Tab1 and Tab2 to accept the params defined TabParamList so I can properly render these components with the neccesary data. How would I create the interface Tab1Props and Tab2Props?import {...
View ArticleReact-Native File 'expo-module-scripsts/tsconfig.base' not found
my problem is like this// @generated by expo-module-scripts{"extends": "expo-module-scripts/tsconfig.base","compilerOptions": {"outDir": "./build" },"include": ["./src"],"exclude": ["**/__mocks__/*",...
View ArticleI want to get the pdf file the API in react native. I am trying this
This is where i am getting my API's.I have used response type blob to get pdf file from the api but i m unable to do so..const CourseApi = createApi({ baseQuery, reducerPath: 'CourseApi', tagTypes:...
View ArticleOnesignal push function does not exist on type 'typeof OneSignal'
Here is the code:OneSignal.push(() => { OneSignal.isPushNotificationsEnabled(function(isEnabled: any) { if (isEnabled) console.log("Push notifications are already enabled!"); else console.log("Push...
View ArticleHow to implement the web3 in react-native
In my project using react-native, I want to use web3.But I'm unsure of how to use Web3 with React Native.
View ArticleHow can I join a duplicate value within one object?
This is an example of the object:[{index: 0,name: "name 1",key: "key 1",value: "value 1"},{index: 0,name: "name 1",key: "key 2",value: "value 2"}]I want to make it so the duplicated value are...
View ArticleRN FlatList with Typescript and Styled Components
SO community,I can't figure out the correct type definition for an RN FlatList styled with Styled Components in TypescriptSo I have type IProduct like thatinterface IProduct { id: string; name:...
View Article