Category "typescript"

Is it possible to set top border on ChartJS Doughnut Gauge chart

Target Doughnut gauge with green top border: Example Doughnut gauge: https://codesandbox.io/s/jlonjk9zv5 The question: Is it possible to implement abovemention

React - react-final-form validation

I have a question regarding react-final form error message when using record-level validation. I have the following field present within FormFilterFields compon

react-select and typescript: Type 'string' is not assignable to type 'ValueType<OptionTypeBase>'

I am trying to create an example component that uses react-select with typescript. For this, I created a functional component and added the default example fro

How to stop infinite refresh in react webpack app?

When I change the TS file, Webpack doesn't stop refreshing the page. Console says: @ebpack 5.66.0 compiled successfully I've googled this and tried different pl

Deprecated compiler module in Angular 13

with Angular 13 I'm seeing deprecations for the usual compiler tools to instantiate an NgModule and Here is my usual go-to code for loading a module contain

Print file on client side

I am using FileSaver.js to print an object array on the client side (HTML/Typescript). var blob = new Blob([JSON.stringify( marray)], {type: "text/plain;charset

How to use moment in nestjs application

I want to use momentjs in a nestjs app, and also be able to test my services. So I provided momentjs as below in my module providers: [ { provide: '

What is the correct type for React Click Event?

I want to use a type for my event handler instead of using type any, Can anyone help me with this,please? here is the code I'm trying to refactor: const MyComp

Exported variable 'store' has or is using name '$CombinedState' from external module error Redux toolkit and redux persist

Hi I'm trying to get redux persist working with redux toolkit (also in typescript) I'm getting the following error: Exported variable 'store' has or is using na

Typescript asserting types if they have one property true or false [duplicate]

I have the following function: type Option = { map?: { lat: number, lng: number } location?: boolean } const foo = (option: Opt

Nest.js is giving cors error even when cors is enabled

I am developing a next.js application with nest.js as the backend. Now, I am having cors error even when I have cors enabled in my main.ts file of nest.js. Here

Prisma, update scalarList/array

I´m doing an Spotify clone and I´m trying to add a song to a playlist but my query doesn't work, until this point, everything was good following the

Typechecking React library with Styled Components

I'm currently working in a design system library to test some things. Basically, the library is a Styled Component wrapper in order to create themes. I built th

Selected Field Value visible in matToolTip but not in disabled divTable dropdown

I have the following code: table.component.html <div *ngFor="let person of persons; let i = index;" class="tbody"> <div class="row"> <

Webpack5 + react-refresh-webpack-plugin does not work

I wanted to setup react with webpack, babel, and typescript myself since I would like to know more and have a consistent boilerplate for development. I have bee

Function with RxJS and combineLatest sometimes works and sometimes doesn't

If you call this function multiple times with the values of the observables obs1 and obs2 being the same each time, the returned array is not always the same. g

Declare types from file with `export .. from` to global interface

I have the file with a lot of export { default as NAME } from './PATH_TO_FILE'; And I want to declare types to global @vue/runtime-core inside GlobalComponents.

How to use Haversine formula in Sequelize-typescript to get distance between two coordinates

SELECT id, ( 6371 * ACOS( COS( RADIANS( db_latitude ) ) * COS( RADIANS( $user_latitude ) ) * COS( RADIANS( $user_longitude ) -

Nuxt Error : Cannot read properties of null (reading 'addEventListener') default.vue and index.vue not rendering

I'm using nuxt.js and vuesax as an UI framework, I did modify my default.vue in /layouts with a basic navbar template exemple from vuesax. Then I used @nuxtjs/r

Class constructor optional parameter

I want to be able to initialise a class with or without value. If you pass a value then all methods of this class will expect this value as an argument and the