All Questions
Tagged with javascript reactjs
207,541
questions
0
votes
0
answers
8
views
@iFrame-resizer/react implementation error - Uncaught SyntaxError: Unexpected token 's', "scroll-to-top" is not valid JSON
I am using the latest version of iframe-resizer/react for automatically adjusting the height and width of the iframe.
Whenever I'm reacting the content, I'm getting a runtime error stating -
VM2860:1 ...
0
votes
1
answer
15
views
The input in searchbar disappears when i click on any other space/part of the browser of when i click tab button
import React, { useState, useEffect, useRef } from "react";
import { useNavigate } from "react-router-dom";
import axios from "axios";
import Autocomplete from "@mui/...
0
votes
0
answers
14
views
TypeError: Cannot read properties of undefined (reading 'quantity')
Ecommerce site using MERN. This is the Navbar.jsx component. Error shows cant read undefined 'quantity' on line 72.
ERROR MESSAGE
Uncaught TypeError: Cannot read properties of undefined (reading '...
-1
votes
0
answers
10
views
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax,
This is the error i am getting:
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such ...
-1
votes
1
answer
20
views
How to define a variable of exported type in React?
I have defined a custom structure in a separate file:
//status.js
export const status = [
{
id:0,
label:"In progress",
},
{
id:1,
label:"...
0
votes
0
answers
8
views
Lightningchart JS - Chart is not interactable
I have 5 different line charts being rendered in my React app. Below is one of the methods to create those charts.
function createEcgHeartRateChart(
response: any,
startInterval: string,
...
0
votes
0
answers
28
views
I get the error that there is nothing available
I get the following error in the project I developed using React and Typescript.
export 'useTableProps' (reexported as 'useTableProps') was not found in './useTable' (possible exports: useTable)
It ...
-1
votes
1
answer
43
views
How to convert this raw pdf to pdf file
I have an api call which returns raw pdf. I'm storing them in a variable called rawpdf. I want to display that in my webpage. As shown here is the raw pdf file
//axios function retrned data
%PDF-1.4
%�...
-1
votes
0
answers
12
views
Screenshotting of SVG D3 diagram with wrong rounding edges
I'm trying to take a screenshot of SVG of my Sankey diagram generated by D3.js in React app. Every time I try to capture it using different libraries and methods, the edges of the links become rounded....
1
vote
0
answers
11
views
e.nativeEvent.offsetX is 0 on mouseMove inside setState function
I have the following code that gets the cursor position on a canvas element. The code works fine in Chrome, but in Firefox, the e.nativeEvent.offsetX is 0 inside the set state function and outside is ...
0
votes
0
answers
13
views
How to debug scroll event fired a lot later than the pointermove event?
With Chrome's 20x slowdown + device emulation, you can see that the first scroll event occurs 230ms after the first mousemove event:
On Android (a flagship 2023 phone), without any artificial ...
-2
votes
0
answers
21
views
Why res.clearCookie() is not working after deploying to vercel?
First of all, everything works fine when running on localhost.
However, after deploying the app to Vercel when the user tries to log out it should clear cookies with res.clearCookie() but it doesn't ...
1
vote
2
answers
31
views
How can I import file w=in complex file structure?
I have the following project structure:
.src
.FolderA
.File3.js
.FolderB
.File2.js
.File1.js
How can I import File1.js from File3.js?
I have tried import '../src/File1.js'....
1
vote
1
answer
37
views
Is there a way to programmatically change screen size for tailwind class
I am building UI-kit with react tailwind.
I know that tailwind can't find classes that made with template strings. I want to achieve this:
I have a few components in my ui kit and I want them to have ...
1
vote
1
answer
45
views
How can I use React Context API efficiently
I'm making React web application and beginner. As I used Context API, I had a problem.
Here's my code.
import React, { createContext, useState, useEffect } from "react";
export const ...