Category "typescript"

getting response data on logger interceptor

I am trying to log the response data by using logger interceptor, but when I send a new request I get output before undefined after instead of what i expect to

Observe (get sized) control (listen to events) over a nested component in the react and typescript application via the forwardRef function

I have a functional component called MyDivBlock const MyDivBlock: FC<BoxProps> = ({ }) => { {getting data...} return ( <> <div clas

TS - NodeMailer OAuth2 'auth' does not exist in type 'TransportOptions

I have a problem. I need to make email sending function with Gmail api. In docs it tells me to make a createTransport function like this: const transport =

I want to be able to append the selected value from a mat-select to the text area below on click

I have been asked to do this project using Angular in work and honestly not touched Angular 2 before. I can do this no issue using jQuery but I am having troubl

Error: export 'control' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports)

I have a angular application and need to use the custom leaflet package: https://github.com/Raruto/leaflet-elevation I am trying to use this in my application.

React Navigation V5 custom header + Typescript Error: custom property 'rightButtons' does not exist on type 'object' (router.params)

I create custom header: const header = ({ navigation, route, options, back }: NativeStackHeaderProps): React.ReactNode => { const buttons: HeaderRightBut

How to create type/interface from another type interface?

I have interface of values types: interface ValuesTypes { foo: string; bar: number; } and Union of Controls: type Controls = 'selectFoo' | 'tbxBar'; and m

Overload Signatures and the Implementation Signature in typescript

I am reading Typescript handbook and I am having a hard time to understand why the following code snippet have error message: function fn(x: string): void; func

next build command is not ignoring *.stories.tsx files [duplicate]

I am trying to build nextjs project which has [componentName].stories.tsx side by side with component itself. Running next build fails because

In Jest, how do I mock a Promise of void?

I'm using Jest and Typescript. I have a async function that returns nothing (void). How do I mock returning void? I tried the below const myMockFn = jest.fn(

onSubmit form send data to another component/route in React

I am currently having a react component, where I have a small form: const firstName = React.useRef(null); const handleSubmit = e => { const data = {

Attempting to add multiple items to SP list using sp/pnp but getting error on ```createBatch()```

I'm following this documentation: https://pnp.github.io/pnpjs/sp/items/#add-multiple-items But I'm getting an error with: import { SPFI, spfi, SPFx } from "@pnp

How to extend my type while I'm extending other type already?

export type InputProps<T extends FieldValues> = { control: Control<T, Record<string, unknown>>; name: Path<T>; placeholder?: strin

How to remove listner in the right way in react native navigation with class components

when I use removeListner function to remove the listner on navigation, I got a warning about that and that the remove not works correctly. componentDidMount()

How to send a ngfor object variable to a function

I have a *ngFor list for my categories and inside to list i wanna show subcategories list. subcategory data coming from firebase so i querying it with category_

how to get the browser time in React [duplicate]

Is there possibility to get the browser time in react. Is there any library that can help with this. The web page should display the time of t

Avoid re-build of AWS Lambda Layer in CDK

I have a CDK stack that, among other infrastructure elements, deploys an AWS Lambda Layer (or actually a lambda.LayerVersion). I noticed that every time I updat

Angular - Access to object attribute with a string variable in property binding

I would like to use a string "attribute" as a key to access the value of a field in the "anim.animals" object. "anim" is an object of type Response that contain

Visiting a Url in cypress

I have a deployed application. when i open the url the website opens just fine. when i try to test it using cypress i become cy.visit() failed trying to load:

TypeError: Cannot read properties of undefined (reading 'NaN')

[enter image description here][1] I am not sure how to make this code work, cannot read properties of undefined (reading 'Nan') Here I'll attach a screenshot o