All Questions
581
questions
0
votes
1
answer
19
views
How to fix: Property 'geocodeService' does not exist on type 'typeof import("node_modules/@types/esri-leaflet-geocoder/index")'
I'm having a typing issue with the Esri Leaflet Geocoder types package. https://www.npmjs.com/package/@types/esri-leaflet-geocoder
Here is how I'm importing it:
import * as L from 'leaflet';
import '...
0
votes
0
answers
21
views
How to Mock a Boolean Hook and a Database Update Call Within a Custom Hook to Bypass Them
The issue I am facing is that I have a custom hook that is asynchronous and does three main things:
A. It makes a check; if the check is true, it continues.
B. It makes a Firebase call; if successful, ...
0
votes
0
answers
29
views
Could not find a declaration file for module import
Could not find a declaration file for module
'openai/resources/beta/threads/index.mjs'. 'c:/Users/git-projects/\[project\]/node_modules/openai/resources/beta/threads/index.mjs' implicitly has an 'any' ...
0
votes
1
answer
39
views
Unable to open MUI Dialog from parent component in React
I am using React Typescript and MUI. I have a parent component with an 'Edit' button, when clicked , should display Dialog box with a form pre-populated with that specific data from the parents.Can ...
0
votes
1
answer
75
views
How to create Socket io with TypeScript and react context
I'm trying to manage Socket.io as a react context.
I don't know how to give the type and default value when calling createContext().
I couldn't find any examples of managing with context even in the ...
0
votes
1
answer
18
views
Property 'opacity' is missing in type '{}' but required in type 'LoaderProps'
I am using TypeScript(tsx)
import React from "react";
interface LoaderProps {
opacity: number;
}
const Loader: React.FC<LoaderProps> = ({ opacity }) => {
return (
&...
0
votes
0
answers
115
views
React Hook Form TypeScript error with defaultValues. TS2322: Type is not assignable to type `UnpackNestedValue<DeepPartial<TypeOf<Schema>>>`
Playground with the code
I'm using react-hook-form and Zod for form validation in my TypeScript application. I have a form component that accepts props with generic types. However, I'm getting a ...
0
votes
0
answers
32
views
In a TypeScript Next.js and Three.js project, how can i resolve an error while attempting to render a 3D model using @react-three/drei?
the error specifically points to the file Text3D.js within the @react-three/drei package.
The error message states:
./node_modules/@react-three/drei/core/Text3D.js
Module parse failed: Unexpected ...
0
votes
1
answer
9
views
Issues with Displaying and Persisting Values in Select Component
I've written a component that represents a select with a set of options. Options are pulled from an object. The idea is that instead of 0, I want to display a cross (\u{274C}), and I also want to be ...
0
votes
0
answers
70
views
How to import audio .wav file in next js and typescript project
error: Module parse failed: Unexpected character '☻' (1:5)
error: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://...
-3
votes
1
answer
45
views
Axios becomes a promise
The console.log outputs of the api and axios variables in the following code are different, even though I didn't change anything. api is the normal axios but the state axios becomes a Promise.
import {...
0
votes
1
answer
27
views
Cannot assign argument to parameter of type 'SetStateAction<EventDetails[] | undefined>'
In a ReactJS project I am trying to update state that was created as such:
const [eventsData, setEventsData] = useState<EventDetails[]>();
However, when I attempt to assign the new state by ...
0
votes
0
answers
44
views
How to propagate module augmentation of custom MUI theme inside a component library monorepo?
In my company, we're building a monorepo of component libraries (no app). In our core package, we're exporting a custom MUI theme with custom brand options (using module augmentation, as per the docs),...
0
votes
1
answer
63
views
Completely incorrect TypeScript errors: Property x does not exist on type y
My team and I are experiencing some obviously incorrect TypeScript errors in a React project.
Here's some JSX:
<PatchField
name="name"
...
0
votes
0
answers
124
views
What should be the type of ref variable for Ant Design Tree component?
What should be the correct type for the treeRef variable here in TypeScript?
const SomeTree: FunctionComponent = () => {
const treeRef = useRef();
return (
<Tree
showLine
...