Category "typescript"

i18next/i18n Change Language not working with the whole website

I'm doing a react-typescript app where I need to be able to translate the site. I'm using the i18next library. In the main page the user can change the language

File upload in angular 11

I am starting on angular 11 and am trying to upload a file or multiple files as a post request to my back end API ( that I created in node.js ) Here is the code

React, typescript: Wrapping text inside table <td> doesn't work

I'd like to wrap the text inside a table cell. I tried "flex-wrap", "break-inside" and similar properties, nothing has worked so far. It has already worked a fe

How does Typescript know where dist/index.js is, if it doesn't exist?

There is something I don't understand about this. I am trying to learn Typescript and I got me this boilerplate code using Snowpack and it contains an index.htm

How to refer to a class with private constructor in a function with generic type parameters?

I have a base class and multiple classes that extend that base class which all have a private constructor. I now want to create a static function that creates n

Typescript based React: importScripts() gives: 'importScripts' is not defined no-undef

Following Google Workbox instructions, the first thing I am told I should include in serviceWorker.js is: importScripts('https://storage.googleapis.com/workbox

Import Typescript/JSX code directly from npm package

I am trying to build a very basic custom npm package which will be imported in a Typescript React app (created with CRA). React app ALPHA: import {MyText} from

React chartjs 2 - Type 'string' is not assignable to type '"timeseries"'

I've been trying to set x-axis as timescale in react-chartjs-2, but can't get past this following error. Chart options code snippet: const options = { plugin

Create an interface in typescript in which only one of two properties are allowed?

Let say I have an interface interface ICart { property1?: string, propert2?: string, someOtherProperty: string } How can I enforce that only one

How to save line breaks in database

I'm using typeorm to management my databse with nestjs framework on server and vuejs on client side, in settings i must provide a large text and i must to save

React useState - using one State per component vs multiples states? [closed]

What is a better way to optimize and do the code more readable in React using Hooks / Functional components; Having a single setState hook or

Vue 3 - Extend a Vue component with additional props with Typescript support

I'm trying to extend a 3rd party Vue component (from PrimeVue) and add additional props, but I'd like to keep the typings of the original component and also uni

VeeValidate and YUP async lazy email validation sending requests for every input in form on background

I'm trying to add lazy e-mail unique validator to my registration form. It works but when i type something in other fields (including e-mail field also) unique

How to check type of object in typescript

I have a JSON file containing two different types of Objects in it. I want to iterate over the JSON with respect to their type. To illustrate my problem I creat

NestJS and Mongoose find by reference object Id

I have a Mongo collection of Users and a collection of Addresses. Each address is owned by one user.Here are my schema classes: export type UserDocument = User

Will my code be transpiled twice if I use TypeScript in a Vue.js 3 project?

I'm not very experienced in either TypeScript, Vue, or the Node ecosystem. I have a working setup created using Vue CLI, with Vue 3 and TypeScript, pretty much

React-Hook-Form - defaultValues not updated are not registered

I have a form who get updated directly when an user change an input. For that, I use the onBlur method. When I change an input from the defaultValue, it save it

Is there a more functional way to merge and foreach/sort two arrays in TypeScript, React?

I'm learning React and TypeScript. For sake of practise, I've tried to create a calculator design by merging two arrays to map a single array onto the grid (dis

How to fix: No changes in database schema were found - cannot generate a migration?

I searched a lot and there are several questions like this however most of them do not have any answer or are not relevant to me. I'm using TypeORM(v0.2.45) wit

how to use Arrow function in a inline event handler [duplicate]

I have this component (vue3+ts) <q-input type="number" filled model-value="Model.Code" @update:model-value="val=>console.log(val)" />