I am making a website to modify db data. first, The structure of the component is as follows When the row component is created,creating the ref of the input component and redux manages it. Input component only receives ref as forwardRef And finally, the redux module The problem area is the delete button. When…
Tag: reactjs
Openlayers map implemented in react does not work on mobile
I have an implementation of the OpenLayers map in react which looks like this: The map works very well on the pc browser, the map can be dragged, zoomed-in / zoomed out without any problems. The markers are displayed properly and so on. The issue is that it is not responding to any touch event on mobile. So i…
a dispatch that im trying to push into an array is calling it instead
I have a simple custom hook with a few dispatches and callbacks on them. It looks something like this: This is called a larger component that props open a big edit window. Upon making those changes, I click my confirmation button that does something similar to this: It seems that my updateText dispatch is bei…
React: Props sent by parent are not the same received by child
Basically the title sums it all, I’m sending a prop to a child and comes different. I make a console.log just before rendering of parent and the prop is OK and make a console.log of same prop at the beginning of Child component and it’s different. This is the parent: And this is the child (I remov…
unable to add a border to popup modal
I am using a Popup modal component from the reactjs-popup library. This is how it looks like: I want to add a thick black border to the popup component. How can I do so? My current css doesnt seem to work. Answer You need to set border-style: solid; the default is none. (maybe border-width too)
scrollToIndex out of range: request index1 but maximum is -1 .. React Native
when I run my application it’s okay and work If I create an array and put it in the data in FlatList like this array But when I replace the photos array with an API, The app doesn’t work. I tried more than API, I think the error is in my code not in the API, This error appears to
Setting state to be the value of the label of a radio button
I have a list of radio buttons that in a form. What I am trying to do is have the Breed variable set to the value of whatever checkbox is selected. The problem is I am getting on for the value instead of what the label says. I cannot change the radio button’s name attribute because I need only one
How to use useEffect and for loop to generate multiple JSX elements
I want to use useEffect and for-loop to generate multiple JSX elements but nothing is rendered in this case. warning code: “React Hook useEffect has a missing dependency: ‘renderInfoCard’. Either include it or remove the dependency array react-hooks/exhaustive-deps” Answer I wouldnR…
Alternatives to using multiple reduce() functions inside a map() when handling deeply nested array of objects?
I have an object result which has a property records which is an array of objects with a single sample below: I am transforming it to the following shape with a function I have: This is the function computeData which I used to map over the array and then apply reduce() twice in order to get the object in the
How to declare a variable from a firestore query?
this piece of code works when I press save in visual studio code. But If I refresh the preview page in the browser it shows me this error: Unhandled Rejection (FirebaseError): Function Query.where() called with invalid data. Unsupported field value: undefined I think that the problem is that I’m trying …