Category "reactjs"

hoist-non-react-statics issue on rollup.js build

i am having issues while trying to build my storybook with rollup.js, in my react components i am using @mui/material and in their installation page its asked t

NodeJS/React install xpi file instead of downloading it

Situation : 1.My nodeJS server serves a file like so : fileRouter.get('/firefox', async (req,res)=>{ const mime = 'application/x-xpinstall'

React material-table

this is my app.js code: import { BasicTable } from './tables/BasicTable'; import './App.css'; function App() { return ( <div className="App">

Highlighting text (user input)

I'm trying to involve coding a simple component to highlight substrings of text provided by a user but I'm getting errors when I'm trying to get the value from

When to query inaccessible elements by setting role vs testId vs DOM container in React Testing Library

I understand that the React Testing Library approach is to query for DOM elements in a way that makes sense from a user's perspective (e.g by role or visual tex

Importing Firebase database object in React results in Uncaught SyntaxError: Cannot use import statement outside a module

I'm working on a project where I need to implement Firestore database in a React app, which I do like this: I have a firebase.js file in the src directory which

How to solve: Type error: 'Draggable' cannot be used as a JSX component ? (react-draggable)

I get this error while building this Next.js React project Type error: 'Draggable' cannot be used as a JSX component. Its instance type 'Draggable' is not a

Threejs: How to make camera view only a part of the model and not all of the model?

I have a humanoid model, I want to view only the top part of the model (The head- shoulders - a part of stomach and arms) How can I do that? Here's my code: App

When I try to push an element to a array but it takes only one rest of the elements are got removed automatically. It happen when use useState hook

const [filter, setFilter] = useState([]); let brandList = []; const handleCheckBox = (e) => { const { value, checked } = e.target; if (checked) {

Agora screen sharing in electron with react, Gives permission denied

I am building an electron-react app with Agora for calls. I am trying to implement the screen sharing feature. As described in the following documentation I tri

Nextjs getserversideProps renders without changing meta data from query parameter

I am trying to load query parameters using getServerSideProps to insert Head meta tag based on the parameters response from API request. Currently, the below co

Why has coming Application Error When I deploy code on Heroku? What is the reason of this Error?

Most of the case when I deploy in my nodejs server on heroku. I just faced this issues called Application Error. Now Question is why this error appear when we d

Weird formatting when saving react project file in vscode

I get an error after saving the file, the code automatically formats like the code below error opening and closing tags, automatic carriage return, auto-add {"

reset error boundary on back journey using useErrorHandler hook from react-error-boundary

I am using react-error-boundary package to show the fall back UI in case application throws any errors. The package works fine for me. I need to understand how

Converting a splitted objects of object to array of objects

I have this form of data coming from an API and I want it to convert into different structure in JavaScript . [ { "1": { "id": 1, "coinname":

Changing theme type with MUI createTheme, palette type

In createTheme function on MUI, in the palette section there is a "type" option. I have created two different palettes with type options dark and light as you c

Using ImmerJS to update child (by id) within a parent (by id)

How do I update the content of child12 using immerJS const [fields, setFields] = useState([ { name: "Parent 1", id: "parent1", child

TypeError: this.props.navigate is not a function

I am new to React.js and I am getting following error "TypeError: this.props.navigate is not a function" while calling this.props.navigate(/todos/${id}) in upda

Fullcalendar Event Drop in modal not working

I have problem with editable fullcalendar eventdrop in modal dialog if another FullCalendar is in background. Modal with second calendar open after click on eve

Decrypt AES 256 CBC using crypto-js

i have the following key to decrypt erUF9SRCNQZPCBezVGzYYnUVgwAKZTvXzS5Zhgw6B/4= into "54545fwfwefweffvfdv", I tried searching for similar question but the lack