Category "typescript"

Property `user` does not exist on type `Session & Partial<SessionData>`

I had a code in javascript and I'm trying to convert it to typescript route.get('/order', async(req,res) => { var sessionData = req.session; if(typ

How to get query parameters from URL in Angular 5?

I'm using angular 5.0.3, I would like to start my application with a bunch of query parameters like /app?param1=hallo&param2=123. Every tip given in How to

Only allow specific components as children in React and Typescript

I would like to only allow specific components as children. For example, let's say I have a Menu component, that should only contain MenuItem as children, like

Jest finds tests but doesn't collect coverage

I trying to collect test coverage for this project using yarn test --coverage # i.e. "react-scripts test --coverage" My jest config is this: "jest": {

TS2339: Property 'comparePassword' does not exist on type 'Model<Document, {}>'

I have defined a schema method by using this code. While I use in the service. It is showing a error. // model export interface User extends mongoose.Document

"React has detected a change in the order of Hooks" but Hooks seem to be invoked in order

I am trying to use Context and Reducers via React's hooks, and running into problems with the order of the hooks not being constant. My understanding was that a

Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'

I have a dotnetcore 20 and angular4 project that I am trying to create a userService and get the user to my home component. The backend works just fine but the

Why property does not exist on type in rxjs pipe function?

Why I losing the type in my pipe function? How to fix that? Property 'n' does not exist on type '{}' stackblitz import { of, map, Observable, Subject, pipe, t

'React' refers to a UMD global, but the current file is a module

I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively im

'React' refers to a UMD global, but the current file is a module

I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively im

Typescript compiler error for property that exists

I am using a React package called react-canvas-draw(https://github.com/embiem/react-canvas-draw) and the main class CanvasDraw has a function called getDataURL.

Mock OpenSearch Client in jest unit test

I'm trying to mock out the opensearch client for testing purposes and am running into an error. My app is using OpenSearch (@opensearch-project/opensearch) and

AngularFIre: LImit to 10 most recents registers

I have a query on firebase, but I want to show just the most 10 recents registers instead all of them my code is: videos: Observable<any[]>; construc

Usage of WebView in Typescript template of react native

I am trying to use WebView in the react native boilerplate (template: typescript). I am using WebView from react-native-webview library. /** * Sample React

Angular HttpClient "Http failure during parsing"

I try to send an POST request from Angular 4 to my Laravel backend. My LoginService has this method: login(email: string, password: string) { return this.

eslint complains about typescript's path aliasing

I've set up path aliasing in typescript's .tsconfig so my imports look cleaner. In my code when I try and import my interface like this import { ApiResponse }

Type {} is missing the following properties from type {}: length, pop, push, concat, and 29 more

const function= () => { facets = useSearchMoreFacets( variables ); }; type UseSearchMoreFacets = { facets: MappedFacet[] | undefined; };

Create Command-line Launcher Intellij not found

I would like to use idea pom.xml from command line to launch a simple Maven project, and so I think I need to configure using "Create Command-line Launcher"

Setting for more strict validation on interface methods

We are running a monorepo and have contracts with one interface of methods that takes a request and returns a Promise<Response>. One interface example is

React component type in TypeScript

What is the correct way to describe the type of a react component in TypeScript? Say we have a function which returns a react component. The function: const ge