Category "reactjs"

How to only change selected state value from useDispatch function in redux

I am using google OAuth for authentication in the nextJS project with next-auth and on login, I store the name, email in the store. but in the initial state, I

Content not from webpack is served from /opt/app/public directory

i have a simple application with react and typescript that display hello world on localhost:8080. When i run my application on command line it works and i see t

Why I am getting this error: Error: failed to process internal error: entered unreachable code: assign property in object literal is invalid

during writing code for JSX file I got an error: Error: failed to process internal error: entered unreachable code: assign property in object literal is invalid

button only clicks once, at one div element

this is the onclick function export function changeColorButton() { document.getElementById("friendDiv").style.background = "grey"; } this is the output file.

react native pdf view error resolving dependency

I have been stuck with this problem in react native version 0.64 latest. pdf view is throwing an error while configuring. I don't understand and not found the

How to style the cell edit component in material table?

So the thing is that I am trying to create an editable table using material-table library and when I click on a cell to edit its content, an edit component show

Using only Lodash, how do i isolate an element that occurs the most in an array?

I am currently following a tutorial that covers Lodash and it is prompting me to return this value : { author: "Robert C. Martin", blogs: 3 } given this ar

How to make MathJax faster?

I was working on a website that contains a lot of mathematical expressions. I use MathJax with React (using 'react-mathjax-preview') but I noticed that renderin

Static builds of react js giving error for array.map but developmemnt server is running well

The error is in the functionality where the frontend requests for data from the backend and then uses array.map to display each element of the data. The data is

how to Create multiple row in React Bootstrap table

How I can show stockVendorPriceList in multiple rows like the image below? I mean if I have an Array of Object in stockVendorPriceList it will show them separat

How does React hook handle dependency lists when passing objects to child components?

Parent component like this: function ParentComponent(){ return ( <ChildComponent data={{ x: 1, y: 2 }} /> ) } Child component like this: function

How to access functional component inside a function from an external JS file?

export default function HorizontalLabelPositionBelowStepper() { const [activeStep, setActiveStep] = React.useState(0); const [completed, setCompleted] = Rea

Redux toolkit useselector doesn't grab the state properly

I'm trying to store my current user using redux toolkit. I'm dispatching the action in the Login page and it looks like when I try to grab the user state on tha

How can I fix this select dropdown in React?

I'm revisiting a React app that I created years ago because the dropdowns are no longer working. Code snippet below. render() { return ( <div class

Loop through array with setInterval play button and pause it

I want to loop through a array with a pause and a start button. Right now it automatically plays and I am not sure how to connect the setInterval to the play fu

How to add typescript paths to storybook

I have a react application with a custom Webpack configuration. After adding Webpack aliases that matches tsconfig.json file compilerOptions->paths field the

hide Navbar if user inside dashboard using React js

I am creating my collage project and I want to hide the navbar if the user in window.location.pathname === "/admin" || "/employee" || "/publisher" basically if

How do I call react function in js map?

I have the below code, the problem is in the part where I am calling the RemoveProduct function in the map function: function AddOrder() { const d = new Dat

Lazy initial state - What it is and how to use it?

I am new to react Hooks. Am trying to make use of useState in my code. While I was using it I found a term "Lazy initial state" https://reactjs.org/docs/hooks-

npm install react-google-login not working

i am using following command to install react-google-login for react npm install react-google-login but its not working npm ERR! code ERESOLVE npm ERR! ERESOLVE