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

Image may be NSFW.
Clik here to view.

why change vsc highlighting color in typescript [Option 'noEmit' cannot be...

I'm working on react-native. but my codes began to change color like the rightand come up the errors in tsconfig.json[Error code] Option 'noEmit' cannot be specified with option 'incremental'.tsconfig...

View Article


React Native with typescript doesn't detect the incorrect types

I'm working on RN with Typescript. By using the official instruction I was managed to add .tsx and .ts file but the main problem I faced is that RN doesn't detect the incorrect types in the files at...

View Article


Why does TypeScript not throw a compile error for an undefined type

Here's a simple repro to describe the problem:I created a vanilla RN project using npx react-native init MyApp --template react-native-template-typescriptIn App.tsx, I added let foo:...

View Article

React Native + Typescript: How to use toggleDrawer in a stack screen component?

My question is simple: what should be the type of navData? I'd like to toggle the drawer from the header of a stack screen component but Typescript is complaining because toggleDrawer doesn't exist on...

View Article

How to safely parse JSON?

I want to parse a JSON from the server and convert it to my model.Of course, I can use JSON.parse in combination with a model interface, but the problem is that I should also check if the keys of the...

View Article


React Native Typescript. Non working type check

I'm working on RN with Typescript. By using the official instruction I was managed to add .tsx and .ts file but the main problem I faced is that RN doesn't detect the incorrect types in the files at...

View Article

Input value - onChange vs Manual

I'm trying to pass an array of strings via context api from a child to a parent.I've been doing so through input who push the value written in it to another input that displays all the values pushed by...

View Article

Image may be NSFW.
Clik here to view.

"Continent" selection/Click on image in react-native

I want to create a continent selection in react-native -> which means when the user taps/clicks on a continent the user is directed to another page with all the countries on that continent (e.g...

View Article


If Else Statement for SearchParams [React Native]

I am new to React Native and I am using typescript for React Native. Currently, I am having a difficulty to do if else statement for search function. Below is my code for if else statement for search...

View Article


Image may be NSFW.
Clik here to view.

How do I use App.tsx instead of App.js in React?

I've created a react project with the instructions from it's documentation, which automatically has added the App.js file to the project. My issue is that I want to use App.tsx instead of App.js. For...

View Article

React Native : How to retrieve data from a State with a nested json array and...

I'm using react native expo.I have a react native picker which have the data that i have fetched from my back end api and the whole set of data is stored in an array(properties) inside the state. This...

View Article

map function in React-Native

I am new to React Native and I am using Typescript for my project. I am difficulty to do mapping in React Native. Below is my code for interface:interface Teacher { name: string; sex: string; age:...

View Article

Create Generic Custom Component React

This is react-native question but similar concepts can be applied to react.I want to create a CustomView in react-native. I am using typescript.So far, I have:const styles = StyleSheet.create({...

View Article


Image may be NSFW.
Clik here to view.

setInterval refreshes the app instead of updating the state

I'm coding a countdown with Expo. I'm using functional components, so my state is handled via React's useState hook.let [state, setState] = useState({ secondsLeft: 25, started: false, }); If I press a...

View Article

UseEffect with Prev and Next props in react

In my react application, I have the following code on the dashboard component.const DashboardPage = ({ user, profile, getAuthProfileStart }: IProps) => { useEffect(() => { getAuthProfileStart();...

View Article


ReactJS change background image dynamically doesn't work

I am new to reactJS. I want to create a component to change background images dynamically. I just write a javascript to update background image every 5 seconds but it doesn't work. These images are...

View Article

How to compose ParamList for nested navigators in v5?

Say I have two navigators like this:export type RootStackParamList = { Bootstrap: undefined; Login: undefined; MainApp: undefined; }; export type MainTabsParamList = { Explore: undefined; Profile:...

View Article


Terminal mistakes bit for git [closed]

I am trying to initialize bit.dev environment. Every time I type bit terminal interprets it as git https://share.getcloudapp.com/geu2B9BPDoes someone know what is going on?

View Article

Should we and how to name react-navigation screen prop types?

According to the official documentation about type checking, we have to name our navigation prop type like this:type HomeScreenNavigationProp = StackNavigationProp<StackParamList, 'Home'>; type...

View Article

"parserOptions.project" has been set for @typescript-eslint/parser

I created a new React Native project with --template typescriptI deleted the template directory which came as part of the boilerplate.I then proceeded to add ESLint:module.exports = { parser:...

View Article
Browsing all 6211 articles
Browse latest View live


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