Category "typescript"

How to create a type for file type `Record<string, File>` in zod

I use input type="file" and instead of saving data in FileData I use just plain object and created a type for it: Record<string, File>. It works well, but

I am trying to create a react app with typescript but I keep getting failed to compile on start

I am trying to create a react app with --template typescript and I keep getting this error: ERROR in Plugin "react" was conflicted between "package.json »

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

Attempting to implement FirebaseUI authorization in a Next.js application following this example https://github.com/easywebsify/next-login-firebase. Getting the

Uploading Attachment on Azure DevOps using Create Attachment WIT

I am working on this task in which I am supposed to take a file from the user, upload it on Azure DevOps, create Release pipeline, and then triggerthe release w

Typescript: object with classes as a values

Let's say I want to build a proxy class from this question's accepted answer. So I need to prepare some object which contains all the classes as values: class C

How can I get React.js TypeScript to accept 'parentElement' on 'event.target' with a onKeyDown event?

I have a special accessible element built with React TypeScript and I am trying to define keys to navigate it and to be able to focus within the table element.

Error Typescript - Uncaught ReferenceError: exports is not defined

I am facing this issue. I created this simple app.ts to learn about promises in Typescript: import {Promise} from 'es6-promise' (() => { console.log('inicio

Nestjs application can not run after bundled with webpack

I have a nestjs app and i use webpack to bundled this entire project to a main.js file. My webpack configure file just flowed by this repo ,but when i run npm r

mat-checkbox doesn't render properly inside npx-graph in safari

Have an issue with mat-checkbox in safari and npx-grpah. as you can see below on the screens. this is chrome and on charts mat-checkbox appears properly in eve

vs code node version is older than node version on my system

I was programming with typescript, then this happened when i runned "tsc fileName.ts" "Accessors are only available when targeting ECMAScript 5 and higher." So

Hide or show div element

I would like to find out how you can hide and show div element in react typescript. This is the code that I have so far. Any feedbacks function GetUserInfo (use

reduxtoolkit mocking store with typescript

I found this code from redux documentation // test-utils.jsx import React from 'react' import { render as rtlRender } from '@testing-library/react' import { con

Mocha testing Typescript source file: unable to import node modules

I have setup mocha to test typescript source files. I have successfully run a test on one file that only imported source files, but I'm seeing a failure running

Property 'randomUUID' does not exist on type 'Crypto'

I was trying to use crypto.randomUUID in my angular app v13.1, but it seems not to be available. Gives us this error if you try: TS2339: Property 'randomUUID'

Typescript useState: SetState in Child with argument

thx for any help. How can I pass down setState to a child component and use the c argument without a typescript error? Parent: Passing down setState export inte

Typescript/yarn workspaces - Referenced project may not disable emit

I'm trying to setup a monorepo project using typescript and yarn workspaces. The project's structure looks like this: /example /packages /lib1 Example is an

The type error about the return of mysql2/promise query

I'm using the mysql2/promise library in typescript, however, I can't understand the type of the return of the query method, and I can't solve an error. My code

How to access derived class members in abstract implementation of method?

How is it that Derived is perfectly happy to call this.log() but somehow doesn't know about this.value? I'd have thought value would be set before super() is ca

React Typescript: It looks like you're trying to use TypeScript but do not have typescript installed

I want to create a React application and I want to use a typescript in this application, at first I went to the React website in order to create an application

Generate GraphQL schema from TypeScript?

I have just recently started with Apollo and would like to expose some existing REST APIs through a new GraphQL layer. These REST services are already fully (Re