Category "typescript"

React typescript - Gettting type error when trying to assign React's key prop

I have simple code as follows: /types.ts export type TodoType = { id: String task: String completed: Boolean } /components/Todo.tsx import { TodoType }

Jest not returning exit codes

I've trying to run tests for my Express + TS application through GitHub Actions But even if my test fails, it seems Jest doesn't return a non-zero exit code so

Angular: access variable which is declared inside subscribe function

I'm trying to access a variable inside a subscribe function but it returns to me undefined, please any suggestions: export class InboxmanagementComponent implem

Make the high/low values in step wise from a range in google sheet [closed]

Need google app script to make stepwise to an array of numbers taken from a range cell values. Example suppose the taken cell values from A

How to solve 'T' could be instantiated with an arbitrary type which could be unrelated to 'T | S' (ts2345)

I am trying to implement generic mutation function using ReactQuery, the code works fine but I am getting a type error which I could not solve. Can someone help

How do you implement a simple progress bar in Angular 8?

I would like to implement a progress bar which increases progressively as a variable increases. I've tried it 3 ways, none of them work as I wrote it. Using CSS

How do I fix the "The shadow-piercing descendant combinator (>>>) is deprecated" warning on ng build for production

I'm getting ng-build -c production warnings for all my css in styles that have a '>>>' notation. Warning: ▲ [WARNING] Unexpected ">" /Users/m

compilation error at overload when using replacerFunction callback

I have a function that generates random word: const randomWord = () => { return "obbooobb".replace(/([ob])/g, (match: string) => { if (match =

Can't stop the asynchronous flow

I have the following function: const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => { event.preventDefault(); const

How to use an array defined in Pinia store?

I created a store in order to use the User resource, and that store has an array of roles. What I am trying to do is to search for a specific role in that array

Create an object that contains property names of another object

I am trying to create a TS validated utility that iterates over the first level properties of the object and returns a new one with its property name. JS-wise i

Mutate nested deep object

I have this object const a = { elementErrors: { errorMessages: [], errors: { project: "Issues with this Issue Type must be created in the same p

reacr ssr template won't run : help fix code base

This is an attempt to demo how to utilize react ssr however it is not functional. See git repo and I appreciate any insights or PRs to fix the issues. Clone wit

Calling A Function from the main.ts file to other ts file is not working in Node js

I have a project in Node JS with the following structure: ormconfig.js package.json src main.ts user user.module.ts user.entity.ts user.service.ts (include a fu

Add typescript paths to Storybook - Webpack v5?

Storybook comes with a built in Webpack configuration and till Webpack v4 it was possible to use tsconfig-paths-webpack-plugin and declare custom tscofnig (or a

How to avoid to write `@ApiProperty()` in each dto for NestJs-swagger

I'm researching the way on how to avoid to specify @ApiProperty() in each dto. I know there is exist a way to create file nest-cli.json, and if you specify Prom

Namespace split in multiple files not able to recognize class in same namespace

Hello folks I am working on a backend service using typescript and trying do something like following: a.ts export namespace X { export abstract class A {

Jest with TypeScript (Backend - Node/Express) says Cannot use import statement outside a module

I am working on Jest tests for a Node/Express TypeScript backend. I recently learnt about global test setup which I am implementing to reduce similar variables

how do I make granular signals that works for properties of a whole pure class

I have a class that keeps input events and lets me query the state. class Input { btn() { return this._btn } _release() { this._btn = -1 } _press() { t

localStorage.getItem() doesn't retrieve data on page refresh - ReactJs (TypeScript)

I'm trying to create a to-do list app with ReactJs, working with localStorage the setItem() works fine but the getItem() doesn't return anything except empty ar