I have an input and can filter any letter if the input type is ‘text’. Also, I’m listening to an onKeyUp event to increment/decrement the input value. But there are 2 issues with this approach: The text input does not show up/down buttons on the right side. When the user presses the ‘A…
Tag: reactjs
React holds state of no more than one array element
I’ve come to a halt making this covid19 app where I can see a list of countries on the left side of the screen with the option of adding any number of countries to the right side of the screen, which displays more covid data of the added country. I’m also kinda new to React. Problem is, when I cli…
How to change production build static folder path in a React project?
I have a React project on which I ran npm run build and it made a production build for me. The problem is that it gives me the following stylesheet injected into the index.html As you can see, the path set is ./static/js/ But I want the path to be set to ./static/dashboard/js/5.a4bfdba9.chunk.js I can’t…
How to prevent user from entering negative number in react?
I want to restrict users from entering negative values. I am using min = “0”. With this i can restrict users from decrementing to 0, i.e, users can only decrement value till 0. But they are able to type “-“. How to prevent in react js. https://codesandbox.io/s/react-input-example-forke…
How can I remove a specific index from an array and then insert a new one on that same index?
I am trying to do one thing but I have 2 choices Remove a specific item/index from an array and then insert a new one in that same index. Do not remove the item but edit it with new data. I have this piece of code: It removes the item from the array, but when it adds the new item,
How to store the new updated values with keys from slider Material UI ReactJS
As given in below code, I store the state, and also I am getting values in the “value” variable after using onChange={(…)=>setValue1(…)}, value.target.ariaValueText. My motive is I want to associate it with {key} mentioned in <Form.Lable>, so that I can store updated value alo…
how to dynamically calculate row span for the given array of objects to display table
the JSON data which I get from service has different key-value pair. below is the example data which I need to convert the data in a table in the frontend and the first column and second column values are rowspan. is it possible to get rowspan dynamically based on records? the data I have the code my output i…
Mobx state updating in console log, but not re-rendering
I’ve created a MobX store (React Native project) and am updating a state value on button click. The state is successfully updating as displayed in a console log, but the DOM is not re-rendering with the updated state. Most answers on SO are a little outdated as they recommend adding @observable in the r…
Browser displays TypeError: Cannot read property ‘user’ of undefined
First i do like to apologize if it’s a noob mistake. I’m trying to do a login page but i keep encountering this error. How can i fix this? Thank you all! Image of Error Code image As requested i have put the code in the question, i’m sorry i’m new to stack overflow and coding in genera…
create simple player with HTMLAudioElement in reactjs
I am create web application a simple player. I want to get the current time of the music that is playing. this is log in useEffect and is great. problem when set e.target.currentTime in state .Music playback stops. Answer it will work with a local Audio element: EDIT: to answer to OP why it doesn’t work…