Category "typescript"

Cache manegment in recoil js

I decided to try using recoil instead of redux and ran into the problem of caching mutable collections. To be more precise, the problem is not in the response c

React build suddenly fails inside Docker image

This error is only happening inside a Docker image build: TypeScript error in /app/src/index.tsx(12,10): 'Provider' cannot be used as a JSX component. Its ins

Problem in serverless function (serverless framework) when using sequelize orm to make requests to the database

I’m trying to set up a simple serverless environment using serverless framework, there is only one lambda function that makes a call to the database using

what should be the default value of file in react-typescript in useState

How do I initialize a file through useState in React Typescript? const [images, setImages] = useState<File>(); const [formData, setFormData] = useSt

generic type to add missing properties in type

I have the onMessage function that gets events from SDK of the third party in my app interface TypeA { a:string, b:undefined } interface TypeB{ b: '

In Typescript "keyof Record<string, string>" is not "string"

I'm hitting this wall since days now and I'm not sure anymore if I'm the problem or if typescript is broken... I defined a generic class with the generic extend

type obj values by enum keys (TS)

I have an object with 2 types of values: str and num. I want to type all properties without duplicating of type name. const obj: any = { num1: number; num2:

Why does a proprety call {{hero.name}} work in a <h> but not in a <img>

In the template, the following code works normally: <h3>{{hero.name}}</h3> or even: <a routerLink="/details/{{hero.id}}">{{hero.name}}</a&

Implement Func<T,TResult> delegate in Typescript

Fairly new to the node ecosystem and Typescript. I am looking for how to implement an abstract delegate Func<T,TResult> in Typescript. A C# Example of wh

TypeScript. The function accepts two different objects, but returns one object

I am beginner in TypeScript. I am developing a home project - a weather application, I have two requests to the server, the responses are almost identical, exce

Get error when using createContext with typescript

I am trying to make a context with hooks in react with typescript like this: // StateGlobalContext.ts import React, { Dispatch, ReactNode, SetStateAction } from

Validate typescript definition files for errors programatically

I am generating typescript definition files programmatically. Sometimes an incorrect definition file will be generated from user error. This cannot be changed a

Set the date value to the mat Input date picker in Angular TS

I have a requirement to read the query parameter for date and set the value of the Mat Input value to the value read by the query parameter. I am using Mat date

How can I get Toast-UI editor content?

I am a student studying. I think I'm doing it conceptually wrong. I'm trying to use vue3 and type script and I'm going to use Toast-UI editor. I get an error. r

Custom utility types (generic types) for classes `IsClass` of TypeScript

I am trying to create a generic type to make sure the first parameter to be a class. However, the factory function parameter cannot be replaced by a generic typ

this.activatedRoute.params is undefined in Angular

I have routing in app-routing.module.ts I want to get playerId and teamId from the router but it returns undefined in the console as I subscribe to it in AppCom

How updated object with child component should reflect on parent component

I want to add the macchines in machine array so I defined a specific component with add function in it. So when I add the "process" in "processes" array then it

How to delete a field in a collection with firebase-admin?

I have a collection like this into firebase realtime database: I need to delete the first element (the one that finishes with Wt6J) from server side using fire

I'm unable to load @apollo/client on a React Native Expo app

I'm trying to load @apollo/client on a React Native Expo app. And I get this error: While trying to resolve module @apollo/client from file /Users/andrepena/gi

typescript return type of instance method

how can I infer the return type of an instance method of an extending class? see psuedo code below Note, this might not be possible, after looking into: https:/