I'm trying to create a stateless React component with optional props and defaultProps in Typescript (for a React Native project). This is trivial with vanilla J
I'm trying to test a simple angular 8 service that gets user location using GeoLocation Service from Web APIs for Angular public enableGPS() { if (!this.lo
I am using react-router-dom and am facing an issue with using <Routes>: Here is my index.tsx file: import React from 'react'; import ReactDOM from 'react-
On PowerShell, I got the error message when executing tsc. This never happened before. I am not sure should I mingle with the PowerShell security settings to r
Before I knew any better I used to have my directive defined like this: ... inputs: [ 'onOutside' ] ... export class ClickOutsideDirective { @Output() on
My component has styles that depend on current datetime. In my component I've got the following function. private fontColor( dto : Dto ) : string { // da
I am curious about .d.ts declaration files because I am new to the TypeScript programming language. I was told by someone that .d.ts files are are similar to .h
In this endpoint handler, is there a way to restrict req.query in NextJS NextApiRequest to just string types rather than string | string[]. Fo
I have the following example joi validation schema const joiUser = { firstName: joi.string().required(), // inferred type: joi.BoxStringSchema<joi.Box<
I'm running NextJS with Chakra UI and the problem is when useSystemColorMode is set to true, it ignores the user's choice on page refresh and sets it back to th
I have some code: enum Color { Red, Green, Blue } function getColorName(c: Color): string { switch(c) { case Color.Red: re
This is hardly first encounter I've had with "1 timer(s) still in the queue", but usually I find some way to use tick() or detectChanges(), etc., to get out of
When I'm trying to use spreading in typescript like: .reduce((unique, x) => { unique.some(element => element.machineName === x.machineName) ? unique
It's not essential, but I'm asking out of curiosity. In Object type we can declare optional property by using ?: operator, but is there a similar shorthand when
I've been experimenting a bit with Typescript, but I'm now a bit stuck on how to use async/await effectively. I'm inserting a bunch of records into a database,
How to navigate relative from /questions/123/step1 to /questions/123/step2 within a component using Router without string concatenation and specifying /question
I'm trying to make a project in angular but when I try to compile it shows me these errors over and over till my IDE closes. Watchpack Error (watcher): Error: E
I have a .ts file in node js (latest version of node.js for 07.10.19) app with importing node-module without default export. I use this construction: import { C
I want to test a function A that calls multiple other functions inside it which can throw errors. Here is an abstraction of my code: // file A.ts const A = (ar
I want to test a function A that calls multiple other functions inside it which can throw errors. Here is an abstraction of my code: // file A.ts const A = (ar