Skip to content

Tag: reactjs

Not being able to print an array

i created empty array using the React State Hook, the array starts empty and i have 3 functions to (add to the array), (remove the last element of the array) and another to empty the array. The functions seems to work since i logged the result in the console. But when i want to print the array on a paragraph,

Data Format, how to map this object?

I’d like to map out an array from a backend API call. This comes from a schema which currently has the format of Within this, I have an object, however it looks like this for example: Given the above, i’d like to map through this data on a component. I have tried to store it into a const, then map

React table cell getSelection()

I have a table with an onRowClick handler on the <tr/> element, I want to prevent a click event if I select text inside it, my solution was this: What I found odd is, when I select a text inside a cell, and click on the same cell, the click event is not fired until the selection is cleared, but