Skip to content

Tag: reactjs

filter and map in an object array

I can’t retrieve the user by his customer number. I use the includes function in filter, but this returns the error: Cannot read properties of null (reading ‘includes’) . Despite everything I’ve seen on the forum, nothing solves my problem. I have an array of user object, so I make a m…

Search input loses focus when it doesn’t find any title

Whenever I try to search, I can type only the letters which are similar to the one of the titles. If any letter is different I lose focus from input. It used to work normally before, but Idk what happened now. Any suggestions? How it first looks like: After starting to type on search input: When I type a lett…

React – setting value for all array of objects

I’m creating a simple tracker that has a state checking if the button is either false (not checked) or true (checked). The structure of my data is something like this: I tried creating a function that resets all of the check values back to false. The user can delete a character or add more so I need to …

‘splice’ instead of ‘filter’

I have a field for entering tags. It is also possible to remove tags. And here I have a question. My deletion code is below. Tags can be deleted one at a time, in any order (first, last, somewhere in the middle, it doesn’t matter). But I would like to use ‘splice’ instead of ‘filter&#8…