Questions tagged [typescript]
TypeScript is a typed superset of JavaScript that transpiles to plain JavaScript. It adds optional types to JavaScript. This tag is for questions specific to TypeScript. It is not used for general JavaScript questions.
typescript
232,720
questions
0
votes
0
answers
8
views
TypeScript / NextJS / Redux toolkit issue - useDispatch.withTypes<AppDispatch>(); Not a function
so I am trying to dive deep into learning Redux Tool kit and I am running into dispatch errors.
here is my authSlice.ts file
import { createAppSlice } from "@/lib/createAppSlice";
import type { ...
0
votes
0
answers
12
views
Can't remove text-decoration from <Link> component of Next.JS
I'm getting my hands dirty with Next.JS and having trouble removing the defauly text-decoration of <Link> component. I have a basic array of objects through which I'm mapping within a parent ...
0
votes
0
answers
16
views
Why is switchMap not working if used with a promise
I am still trying to understand how switchMap works internally, and I thought that it should be possible to return an Observable that is actually a promise.
But my expectations are not met... this ...
0
votes
1
answer
23
views
How to define an interface with a required key-value pair?
I am trying to write an interface for a specific function that will take in an object and perform some intended functionality. I would like to type the input to ensure it follows a specific shape.
...
-1
votes
0
answers
8
views
404 Not Found Error When Sending POST Request to Next.js API Route
Details:
I am working on a Next.js application and have set up an API route for handling flashcards in src/pages/api/flashcard.ts. When I attempt to send a POST request to http://localhost:3000/api/...
0
votes
1
answer
34
views
How do I get the position of a React Component?
Here's my Ball component:
import CSS from "csstype";
const circleAroundNumber: CSS.Properties = {
//...
};
interface Props {
num: number;
positionx: string;
positiony: string;
...
0
votes
0
answers
5
views
Rotate an HLS stream into Landscape Mode
I've got an HLS format (M3u8 file) video that I would like to show to users on a web site.
Some of the videos are taken in vertical (portrait) mode, others are in landscape (horizontal) mode.
Ideally ...
2
votes
1
answer
15
views
Data not updating with useParams for react-hook-form
Not entirely sure how to title this, but here's my issue:
I'm making a character sheet of sorts, and you can swap between your characters by clicking on them in the nav bar. When selecting a different ...
0
votes
0
answers
13
views
How to Properly Manage Toggle State in Shadcn with React?
I'm using the Toggle component from Shadcn in my React project to implement a set of stroke toggles. The goal is to have four toggles where only one can be active (pressed) at a time. When a toggle is ...
0
votes
0
answers
12
views
NestJS application in a monorepo with Yarn Workspaces imports only types, not functions from its packages
I am working with Yarn Workspaces in a monorepo with the following structure:
├───monorepo
│ ├───node_modules
│ ├───apps
│ │ ├───backend
│ │ │ ├───node_modules
│ │ │ └───src
│ │ ...
1
vote
0
answers
6
views
Couchbase Node SDK causing error when transpiling and bundling TS code to JS
Basically the issue relies on the step that I run the following command to transpile+bundle my TS code to JS:
esbuild --tsconfig=./tsconfig.build.json --bundle --platform=node --outfile=dist/index.js ....
1
vote
1
answer
31
views
Aggregation function via config array Typescript type
I've been trying to get these types working for a while now. Don't worry about the implementation. I only want to fix the types. The function takes and reduces over the config array using the fn ...
0
votes
1
answer
23
views
Button behavior condition
I have a Submit button that once pressed run onSubmit function.
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
...
<b-button
type="submit"
>...
0
votes
1
answer
20
views
AngularFireDatabase import causing me login/sign up problems - Angular
sidebar.service.ts ( service file for dashboard component ) :
constructor(private db: AngularFireDatabase) {}
getUsers(): Observable<any[]> {
return this.db.list('/users').valueChanges();
...
1
vote
0
answers
12
views
Implementing am5 charts: Error: export 'RadarChart' (imported as 'am5radar') was not found in '@amcharts/amcharts5/radar' (module has no exports)
I am implementing a project using am5charts but after importing the charts I end up with the error on running the project, no erros on the component file but on trying to run the application I end up ...