Category "typescript"

Rename key of typescript object type

I have this: type Two = { one: number, two: string, three: boolean } I want it to create a type that would look like this: type RenamedTwo = { one:

how to use multiple tsconfig files (with conflicting compiler options)?

My codebase contains two typescript projects: for a react web app for web workers The web worker codebase is part of my public/ folder. Which means that there

Cannot read property 'setProperty' of undefined fxFlex issue with ng-container Angular 9 Flex Layout

<div [fxLayout]="fields.layoutConfig.layoutDirection + ' wrap'" fxLayout.xs="column" [fxLayoutGap]="fields.layoutConfig.fxLayoutGap"> <ng-cont

How to use document.getElementById() method in TypeScript?

I am trying to reset HTML Form in order to clear all the values in the input fields using; document.getElementById('myForm').reset(); But I can use that in

How can I use moment.js to add days, excluding weekends?

I'm setting a default follow-up date two days from current date, which currently works: const Notify = moment().add(2, 'days').toDate(); However, I would lik

Bootstrap modal opens on background (Angular)

I have modal that I open from the table, that in the material tab Here is Modal HTML <div bsModal #createOrEditModal="bs-modal" class="moda

How does one add one's own bespoke inputComponent JSX <input /> to a react-phone-number-input PhoneInput?

Code follows this description. react-phone-number-input allows uses to replace its default <input /> JSX tag with one's own, which specifically requires t

Does TypeScript support constructor with object initializer?

For example, in c#, we have this snippet: class OrderLine { public OrderLine(){ OrderId ="1", ItemTitle ="2" Console.W

Using an imported type in JSDoc @typedef

I'm trying to reduce duplication in specifying my imported types as follows but I'm getting an error /** @typedef {import("../types/util")} util @typedef {util.

Using an imported type in JSDoc @typedef

I'm trying to reduce duplication in specifying my imported types as follows but I'm getting an error /** @typedef {import("../types/util")} util @typedef {util.

TypeScript issue with find and filter

let access = environment.access.filter(it => it.roleName === userRole); let access = environment.access.find(it => it.roleName == userRole); Property 'f

Close button round icon for Android and iOS using React Native

I am trying to create a close button with clickable action. here, I need to design round close button icon and place it top of right corner in the view. How to

setState provokes Minified React error #130 only on production build

Every time I interact with the drop-down button on the front page of my application, the error https://reactjs.org/docs/error-decoder.html/?invariant=130&ar

What is the meaning of empty export {} in vanilla javascript/HTML

In the Google Maps Javascript API example, I see they had something like this in the HTML: <script type="module" src="./index.ts"></script> and an

What is the meaning of empty export {} in vanilla javascript/HTML

In the Google Maps Javascript API example, I see they had something like this in the HTML: <script type="module" src="./index.ts"></script> and an

How to make google chrome go full screen in Angular 4 Application?

I am developing an application where I want to implement such a thing where if user leaves from one component & enters other component, then in other compon

How to fix error "Failed to compile : ./node_modules/@react-leaflet/core/esm/path.js 10:41 Module parse failed: Unexpected token (10:41)"

I am trying to create a react-typescript app along with leaflet. I used the command, npm install leaflet react-leaflet @types/react @types/leaflet --save to ins

Requiring a child that accepts a ref attribute in React + Typescript

Using React + Typescript, I'd like to create a children prop that only accepts a single child that accepts a understands and accepts a ref attribute. Basically,

Context API using the initial value not the one set in UseState

I just started using typescript with react and tried to deal with ContextAPI with the typescript. So Far I've set a context and tried to use a provider inside m

Typescript 4.6 and Arrow Functions

We recently updated to typescript 4.6 (from 4.5) and are experiencing some weird this issues. for example we previously had a function defined at #handleUnsaved