Category "typescript"

TS2322: Type 'Count' is not assignable to type 'ReactNode'

I am new in react and TS and I need help I am trying to use useState with typescript import React,{useState} from 'react' interface Count{ count: number } co

Cannot find module '@babel/runtime/helpers/interopRequireDefault' from 'node_modules/react-native/jest/setup.js' when I run tests

I'm trying to build a mobile application with typescript, react-native, expo and jest. When I'm trying to run tests: FAIL src/components/Button/tests/Button.t

How do I import an ES6 JavaScript module in my VS Code extension written in TypeScript?

I am developing a VS Code extension in TypeScript and I am trying to import a JavaScript library from npm that is packaged with "type": "module", in its package

MethodOf type cannot be used to call the method

I would like to dynamically generate some tests, for that I have to call a method with the method name to be called and then all the test setup is done and the

TSyringe: How to change a parameter of an injected object?

I have an app with multiple different components, each component having their own dependency and am using TSyringe to manage dependency injection. One of the co

using Moment with Angular library 13 causes an error

When i use the moment.js (latest version) in an angular library, i am facing the following problem: vendor.js:sourcemap:106713 ERROR TypeError: (moment__WEBPACK

Module not found: Error: Can't resolve the typescript file when adding typescript to a CRA app

I'm trying to add typescript to my project and write new components with typescript. I followed the documentation but I'm got this error:can't resolve [the type

How to resolve the error: Module '"react-hook-form"' has no exported member 'useForm'

I want to make simple login page using react-hook-form I get this error: Module '"react-hook-form"' has no exported member 'useForm' import React from 'react'

Why am I getting "Type instantiation is excessively deep and possibly infinite"?

Playground link I have these general definitions: type Module<P extends Payloads, C extends Children> = { payloads: P; children: C; }; type Child

Rxjs only execute last item in queue with concatMap

I am using NGRX with RXJS. In the effects layer, I am using a concatMap to queue my requests, however, once the latest request is complete, I want to execute th

Proper way of dealing with returning from a fetch

I'm a bit new to coding in a JS/TS way and I just wanted to know the best practice when it comes to returning and handling void and values that come from a fetc

Typescript - Object display correct datas but properties are undefined on access

When I log the entire object all the datas are displayed but when I try to access the properties they are undefined. As if the object's properties where not map

TypeScript: Can anyone difference between unknown and any? [duplicate]

I have a type: type Action<I extends unknown[], O> = (...args: I) => Promise<O>; and some test cases: // should be [boolean, s

Incorrect functioning of routes in Angular

When trying to navigate from 'users' to 'users/:id' like this this.router.navigate([`/users/${userId}`]); or this.router.navigate(['/users', userId]); it stay

How to properly change a array of object to another array of object in TypeScript [closed]

How to properly change a array of object to another array of object in TypeScript? a : [ {bcdbcd : 1, abcabc : "value1"}, {bcdbcd : 2, abc

React project Error: Map container not found

I have a ts project written with React, I want to render a simple map an a rightsider but I got an error report "Error: Map container not found."Below is my met

call javascript void in angular

I am using an html template for a website in Angular This template uses JavaScript to perform page elements. My problem is that when I use ngfor to create an el

Cucumberjs Parallel execution-for 3 or more instances - Only one usage of each socket address (protocol/network address/port) is normally permitted

I am trying to execute Cucumber-js feature files in parallel. Providing number of parallel runs in cucumber.js file let runCucumber = [ --parallel 3, It runs fi

window.removeEventListener not working in Angular

I can't for the life of me find out, why the eventlistener isn't removed on the mouseup event. I have already tried a lot of different things, but I can't remov

Webpack is still parsing unused/unreferenced/not-entrypoint files [duplicate]

I have the minimal Typescript+Webpack setup from the doc, with the following files : Files src/ index.ts // only a console.log in here unused.