Skip to content

React state is updating but the component is not

There is a component that maps through an array stored in the state. A button, when it is clicked it updates the state, this action is working. The problem is that the component is not updating too. …

Discord.js | Chatbot responds to command name

so I’m trying to make a chatbot that sends the message after the user types the prefix and the command name. The command works in general but it seems to also take in the command name. I use a command and event handler btw. This is what it looks like: So when people do a.chat without an arg after that,

How to mock nanoid for testing?

I’m trying to mock nanoid for my testing but it doesn’t seem to be working. my function My test: So basically I’m struggling to figure out how to mock the nanoid which is generated inside the function. I’ve tried the following at the top of the file: however it doesn’t work at al…

Vue Filter one array by an other array

Good morning, I have an array that looks like this: Let’s just call it itemsDelegates. And then I have this one: Now let’s call this addressvisibility. Now I’m trying to remove from itemsDelegates all entries that are already in addressvisibility. I tried the following approach: Nevertheless…