Category "typescript"

Which React TypeScript version to use in development?

I have an existing TypeScript React project that was created before Hooks existed in React, and I'm trying to rewrite all the classes using Hooks. Thus in my pa

Unwanted *.js and *.js.map files are being generated from .ts in some areas of project

I am developing an angular cli v6 project in visual studio 2017 and noticing that unwanted .js and .js.map`files are being generated for some of my typescript f

Updating Apexchart series on daily bases in angular

I am using apexchart but cannot know how to use updateseries I have tried directly sending the values HTML <apx-chart [chart]="{ ty

error TS2306: '...index.d.ts' is not a module

I'm trying to write a lib in Typescript that I want to use in various other typescript or JS projects. All of the those other projects run in browsers. My Type

How can I disable auto new-line in Visual Studio Code?

The problem is after I've installed the Angular extension in Visual Studio Code, I constantly get across all files (.ts, .html, and .css) auto new-line after ty

how to pass data from angular material dialog to parent component?

I'm using angular 6 and I have a button which opens a dialog. in my dialog, I have a form that gets user's data and then I have two buttons to submit and cancel

Create File object type in TypeScript

I have a function that should only accept JS File objects. How do I create that type in TypeScript? edit: sharing my tsconfig.json { "compilerOptions": {

"Consider using a mapped object type instead." - what's a mapped object type and how do I use it here?

When I try to compile this Typescript code interface Foo { [foo: "hello" | "world"]: string; } I get this error message An index signature parameter type

Tuple argument with correct return type for a function

How to return the correct type associated function argument as a tuple? I would like a function to return its value based on its argument's tuple type. The exam

TypeScript Generics column.id should be within row[key]

I'm writing a TypeScript Interface for Tables: interface Column { id: string; label: string; } interface Data { [key: string]: string; } interfac

'unknown' vs. 'any'

TypeScript 3.0 introduces unknown type, according to their wiki: unknown is now a reserved type name, as it is now a built-in type. Depending on your inte

How to pass and receive object in component to NbDialog component nebular ngx-admin?

I want to pass object to NbDialogComponent and how to get object from NbDialogComponent. Anyone say, Is way correct? I try this way for pass object, Component f

Uncaught SyntaxError: Unexpected identifier - importing jquery

i have a problem with import statements in my website project. try to use nodejs - typescript and jquery my project folder looks like that: Project node_modu

'Component' cannot be used as a JSX component. Nextjs

This is how _app.tsx looks: function MyApp({ Component, pageProps }: AppProps) { return <Component {...pageProps} /> } and I am getting this error whil

.filter() does not affect type of array in TypeScript?

check this snippet: interface Foo { id: string; } const fooFunc = (arr: Foo[]): Foo[] => arr .map((item: Foo): Foo | null => { const so

How to run event loop when doing nested/recursive computations?

The usual examples of how to break a computation and release using setTimeout() seem to rely on having a shallow (1-deep) call stack. But what about when you ar

tsc not found in typescript express and react app when deploying to heroku

I am working on an express app(in typescript) and a react app bootstrapped with create-react-app(in js). The directory structure is here. The server directory c

HTTPClient POST tries to parse a non-JSON response

I'm trying to make a request in Angular and I know that the HTTP response will not be in JSON but in text. However, Angular seems to be expecting a JSON respons

Type 'ListRenderItem<IPhotos>' is not assignable to type 'ListRenderItem<unknown>

why I get this error: Type 'ListRenderItem<IPhotos>' is not assignable to type 'ListRenderItem<unknown> Code: import { Dimensions, Image, ListRend

Extend Express Request object using Typescript

I’m trying to add a property to express request object from a middleware using typescript. However I can’t figure out how to add extra properties to