Here is the table I’m trying to create: When I change the value of the dropdown bars, the value becomes undefined and I don’t understand why. But initially, when I click submit, it works and the alert pops up with both of the default values I set in this.state. This is what the alert looks like wh…
Tag: reactjs
Output string after sring.split(“”).map breaks into pieces on small screens
With great help from @pratik-wadekar I have the following working text animation. Now my problem is that when I test it on different screen sizes/mobile the animated word plants breaks into pieces. For example PLA and in the next line NTS. How can I avoid this? So it always keeps as one full word. First I tri…
How to fill message box on Whatsapp Web?
I’m trying to send a message on Whatsapp Web (https://web.whatsapp.com/) only using Javascript, for study purposes. Here is the DIV that has the message box : And here is my code : The code runs without errors, but the message field is not filled, nothing happens on the interface. This code used to run …
React Hook Form Not Updating Value If Default Values Is Array
I am creating a dynamically generated form which reads a file from a template. I have an array of “questions” which are mapped onto a react-hook-form. The defaultValues I am using is an array of objects. The issue I am having is using react-select inside of a react-hook-form controller because it …
Css not loading properly in Reactjs
I am working in reactjs and using (Nextjs) framework,I have All “css,js,images” in “public” folder and in “_app.js” i included all these files,But i whenever i tyring to open “Main page” in browser then page is not displaying (only loader showing) , In other wor…
Adding multiple elements issue using ReactDOM.render in react js
I am new to react js and i am trying to add HTML elements multiple times using ReactDOM.render but when I add elements to the dom multiple times the element is replaced each time not added one by one as a new element this is my code: Answer you can use ReactDOM.createPortal inside of ReactDOM.render like this
React Redux createAsyncThunk actions don’t update the state
I’m implementing a registration page to my nodejs api. With createAsyncThunk I implemented the function to fetch the user data and update the state. The api works correctly, in fact it returns the created user data in the payload when the action is dispatched. But the user state is not updated and stays…
Uncaught TypeError: path.split is not a function in react
I am wondering how I can solve this with new ways of coding. I’ve seen someone say this error is due to the update of react-hook-form, but I am not sure how to solve this. If anyone knows this, I would appreciate it. I originally tried to solve this by adding the “…” before register in…
Theme toggler React – Choice not persisting through page refreshing
I’m trying to apply the theme the user chose to the initial value of useState(), but when I refresh the page, the choice does not apply. What do I have to change in order for the value to persist through page refreshing? theme-toggler.js theme-toggler-button.js Thanks in advance. Answer After a few days…
pass data through the component tree without having to pass props down manually at every level
I have a sidebar on my site. The sidebar contains filters (date and time, model, category, etc.). Each filter is made in the form of a drop-down list. I made the sidebar in such a way that the filters could save their state (selected value, open / closed) regardless of the screen size (that is, the selected v…