Category "typescript"

Typescript: deep keyof of a nested object

So I would like to find a way to have all the keys of a nested object. I have a generic type that take a type in parameter. My goal is to get all the keys of

does native-base have a utility method that allows us to extract computed theme data?

I am using native base and I want to use some of the theme values for example the primary text color and the main background color I am looking for something th

Rollup & Typescript type declarations with absolute imports

I'm making React component library. Project structure is something like: src/ components/ utils/ hooks/ Now I'm trying to generate types (.d.ts.) file

Type 'Element[]' is missing the following properties from type 'Element': type, props, key

I have the standard arrow map ES7 function with Typescript and React environment: const getItemList: Function = (groups: any[]): JSX.Element => group.ma

Default values for optional parameters in options argument

I want to pass an object as argument for the constructor of a class. Some keys of the options object are optional. Is there a better / more idiomatic way of ac

Rollup & Typescript type declarations with absolute imports

I'm making React component library. Project structure is something like: src/ components/ utils/ hooks/ Now I'm trying to generate types (.d.ts.) file

Argument of type (key: string, id: string, pagination: number) => Promise<void> is not assignable to parameter of type Boolean

Not sure what is the matter here, but I am trying to follow this documentation: https://swr.vercel.app/ with this setup of my own: import React, { useEffect } f

How can I pass routes in Next.js?

I'm trying to pass routes to my Next.js app but it's returning an error, I've looked everywhere but I can't find the answer. _App.tsx import Routes from './

How to debug TypeScript in Visual Studio Code

Installing ts-node and typescript locally √  Add a launch.json file √ { "name": "Current TS Tests File", "type": "node", "request":

Typescript Build Fails When Adding Angular into Monorepo (Clashing of Jasmine and Jest Types)

Gist I have a Monorepo with solely Typescript packages. When I run tsc --build all packages will be compiled to Javascript. This worked fine until I added a pa

FormGroup is deprecated

I've already seen some related question & answers, but unfortunately those didn't help me much. ngOnInit(): void { this.form = this.fb.group({ new

Injected nestjs service in to CQRS is undefined

I have a service to import in CQRS but in runTime, I got an error for the service method the service declared in constroctor and using it in excute methode @Com

ESLint error "'svelte' is not defined" when using svelte.JSX.MouseEventHandler

In a SvelteKit project, I have included the a svelte type. My problem is that my linting (ESLint) throws an error saying that 'svelte' is not defined. My code i

How to update atoms (state) in Recoil.js outside components ? (React)

I'm new to Recoil.js, I have the following atom and selector for the signed-in user in the app: const signedInUserAtom = atom<SignedInUser | null>({ k

cannot initiate expo bare workflow with typescript

I`m trying to initiate expo bare workflow with typescirpt. But after I type "expo init [project name]" in command window, I cannot find minimal(typescirpt) opti

Prevent multiple identical http calls from Angular service

I've a service to get the data from an API in my angular app. The service is used in different components - and the same http request is send multiple times. To

Omit undefined values when creating object literal

Say the interface has an optional property: interface Foo { foo: string; bar: string|undefined; } We have a value that might be undefined: makeFoo(bar: str

React Three Fiber OBJLoader conflicts witth @types/three

I am following the official React Three Fiber Docs here. I am trying to load .obj files into my scene, using this article: react-three-fiber docs: loading obj m

How to get rid of the warning .ts file is part of the TypeScript compilation but it's unused

I Just updated angular to latest 9.0.0-next.4. I am not using routing but suddenly after updating I keep seeing this warning. How Do I remove this warning W

What To Do Failed Compiling?

I am getting an error while running the command npm start. The file is created in PancakeSwap Frontend and I've been trying to fix this for a while, thanks for