Category "typescript"

How to use React Keycloak?

Did according to examples, but I get an error: http://localhost:3000/#error=login_required&state=19004288-e312-4782-ac23-9dc038cd7bb0 Here is my code: keyc

Uncaught TypeError: Cannot read properties of undefined (reading 'isBatchingLegacy')

I am trying to test a react typescript project using jest but it's giving a confusing error: Error image Here is my package.json: "dependencies": { "@testin

Typescript generic object in array only match the specified Records

Demo: https://tsplay.dev/Nnavaw So I have an array with the following definition: Array<{ id?: string; text?: string; date?: Date; }>

vue.js cannot use data property in computed method

I'm trying to use a property of my data in a computed method like this: data() { return { ToDoItems: [ { id: uniqueId("todo-"), label: "Learn

How to keep marker at the bottom of the screen when zooming like google maps?

I was wondering if it is possible to change the default behavior zoom, the default seems to change the viewport in all directions, but I want to keep the bottom

How to access nested conditional type in typescript

The origin of the following autogenerated type is a GraphQL query: export type OfferQuery = { __typename?: 'Query' } & { offer: Types.Maybe< { __ty

React attrs method Typescript

I am getting following warning. I am using typescript. "Over 200 classes were generated for component styled.div with the id of "sc-dkzDqf". Consider using the

Angular Material custom form field doesn't show mat-error

I thought I have almost the same example but somehow the control tricks me :-/ <form [formGroup]="form"> <app-ref-urlcheck [maxLen]="20" formContro

every first react-native component gets typescript error

When I use the Text component of react-native, I get this error: No overload matches this call. Overload 1 of 2, '(props: TextProps | Readonly<TextProps>

electron-forge with two windows : how to render the second window? electron-react app

I realized that the second electron browser window, does actually opens, but it doesn't render correctly. In /tools/forge/forge.config.js I have two entryPoints

Merge two arrays with child elements

I've two arrays as follows and trying to merge with id in this case, menuNo is the id and after that, it'll have a new array with child elements as output. Pare

NextJS - new Date cached on server

i am trying to always get a now Date on my server, but it get a cached date. I use yarn export to upload my files on a hosting server via ftp. My code is: expor

how to gracefully combine two Observables inside RXJS pipe

I'm building a log viewer with Angular. When a user enters the page I need to load historical logs and start watching for new ones. User can filter logs with a

Understanding Typescript code example based on uniswap code

In the uniswap website there is the following code in the Swap page (https://github.com/Uniswap/interface/blob/main/src/pages/Swap/index.tsx line 115) const {

How can I get data from service in Angular interceptor?

I want to add my authentication token in the request header in my auth.interceptor.ts and I'm keeping the authentication token value in my auth.service.ts. Here

how to set up cors() in typescript express

In one of my projects, simply this worked: import cors from "cors"; server.use(cors()); but currently I am having this lovely typescript warning message in my

Typescript issue during compilation around `webpack/HashedModuleIdsPlugin`

I am getting compilation issue around HashedModuleIdsPlugin and typescript :( When compiling a TS project that allow JS, requires HashedModuleIdsPlugin and expo

Replacement of deprecated MediaQueryList.addListener() event in Angular 8

As the mozilla developers docs says MediaQueryList addListener is deprecated. I'm using it in my Angular 8. Though it's working it's linting warning in VS Code

Ionic 4 ion-input allow number only, restrict alphabet and special character

I am creating an app in ionic4, I have a functionality where user can enter the only integer number (0-9), so I want to restrict any other character i.e alphabe

Why are function parameters not treated as compulsory when implementing an interface?

I have recently noticed that I was able to implement a function from an interface and remove the parameters and that worked fine. I have some sample code below