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

Image may be NSFW.
Clik here to view.

TypeScript errors in Reactnative project

I am getting error in React native:"Import type should be used only in TypeScript files".I installed a library called viewPager but it is showing 9 errors mentioning:"Should be used only in TypeScript...

View Article


different ways of returning array types [closed]

I have a working function that looks like this: const handleClickOnFavouriteLocation = (item: any) => { console.log('MY COORD', item.coordinates); if(data){ console.log('DATA COORD',...

View Article


different ways of returning array types (data returned via graphql)

I have a working function that looks like this: const handleClickOnFavouriteLocation = (item: any) => { console.log('MY COORD', item.coordinates); if(data){ console.log('DATA COORD',...

View Article

Image may be NSFW.
Clik here to view.

All styled components return any (@types/styled-components)

I'm having a weird issue when using styled-components along with VSCode. Below is basically what I get for any components coming from styled-components, they all return any.I got it working before, but...

View Article

React Native TypeScript Error: Module '"react-native"' has no exported member...

I've recently implemented dark mode into my app, but having an issue with an error when building the npm package with npm build. The code works, but is there a way or a reason to remove this...

View Article


How to render .map() val and key as a prop outside of setState callback

I have this component which performs a post request and maps json data that I get in return. On this response I do setState and map the data in the callback. I do this because of setState's async...

View Article

Typescript definitions for Animated.View's style prop

I have component whose Props interface extends ViewProps from React Native, i.e:export interface Props extends ViewProps { // Custom props}Naturally, this extends the style prop. There is one caveat, I...

View Article

Image may be NSFW.
Clik here to view.

fix position in RN StyleSheet

I am rendering an item in a list like this: return (<View style={styles.item}><View style={styles.nameAddressContainer}><Text...

View Article


Trying to dynamically set interface based off of enum value

Hey all I'm trying to dynamically set a style interface to a type like this:type IListStyles = { [LIST_TYPE.ADD_ACTIONABLE]: IListItemAddActionableStyle; [LIST_TYPE.SUPERVALUE]:...

View Article


How do I configure absolute paths for imports in TypeScript based React...

In order to avoid '../../../../' style relative imports in a TypeScript based React Native app, I would like to configure the app so that I can use absolute imports instead.It is important that the...

View Article

erase formik error after submitting a form

When I enter the screen, there's no error displayed on the input field. In my Formik form, I take an input and run a graphql mutation on it. Once it's done, I reset the form. However, after resetting,...

View Article

How to specify (optional) default props with TypeScript for stateless,...

I'm trying to create a stateless React component with optional props and defaultProps in Typescript (for a React Native project). This is trivial with vanilla JS, but I'm stumped as to how to achieve...

View Article

Type issues with Dynamic StyleSheet property access

I've created a React Native functional component with both light and dark theme styles.const lightThemeOverrides = StyleSheet.create({ <light_override_styles_here> });const styles =...

View Article


Why are the buttons not clickable when ImageBackground is used?

I implemented ImageBackground for my React Native app and when I run the emulator it doesn't allow the buttons to be pressed. The Buttons were tested beforehand and do function normally.I feel like it...

View Article

What are the consequences of adding ios and android directories in exclude in...

Should one exclude ios and android directories in tsconfig.js in a react-native project?{ ..........."exclude": ["node_modules","babel.config.js","metro.config.js","jest.config.js""android""ios" ]}

View Article


Unable to resolve module `perf_hooks`

I am trying to use perf_hooks from the nodeJS Performance API in my React Native project. Below is my codeimport {performance} from 'perf_hooks';export const measure = ( target: Object, propertyKey:...

View Article

Image may be NSFW.
Clik here to view.

SafeAreaView only shown at bottom

I am using SafeAreaView on multiple screens and it works fine everywhere except on one screen. Here, it shows up at the bottom but not at the top. At the top, the backgroundColor from the...

View Article


Image may be NSFW.
Clik here to view.

react-native-tab-view with redux crash if open tab before data is ready to...

I have redux + API which getting data from the server then convert it to state object for react-native-tab-view from redux://types import { NavigationState } from 'react-native-tab-view';export enum...

View Article

Image may be NSFW.
Clik here to view.

Deep link with react-navigation v5

I'm trying to use deep links in react native project with react navigation but I got some weirds scenarios in both platforms(ios & android).My codeNavigationContainerconst linking = { prefixes:...

View Article

Cannot add a child that doesn't have a YogaNode to parent without a measure...

I've a problem that don't render my react native app. I'm developing it with expo using TypeScript. There is no description about where the error in my code.I get this error when I start it on my...

View Article
Browsing all 6213 articles
Browse latest View live


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