Skip to content

Tag: javascript

How to create a role with discord.js

I’ve been trying to make a discord bot using discord.js, but I can’t seem to find any documentation on how to create a role that works in 2018. All the ones I can find that work, no longer work as they have removed the referenced function. In https://discord.js.org/#/docs/main/stable/class/Role th…

I can not write any value from input on mobile device

I have a problem with touchstart in my jquery code. My jquery code doesn’t allow me to click any button, input or other elements when I open the page with a mobile phone. Please click this DEMO . You can click the inputs and you can write something on there. But open chrome developer console now click t…

Detect an URL change in a SPA

I would like to listen to path changes in a SPA which is not maintained by me. I found one solution here: https://stackoverflow.com/a/44819548/7042552 But still, it seems kind of “hacky” to me – but still my implementation is like this: Is there a better or more generic way to listen for pag…

React + NodeJs Fetch issue

I am trying to fetch the following results of my api (which is working well) http://localhost:5000/api/continents into a react component (a simple array to begin with). Endpoint code extracted from server.js: Here is my continents.js code: And here is the App.js code: Issue: continents array is empty. No data…

Make React useEffect hook not run on initial render

According to the docs: componentDidUpdate() is invoked immediately after updating occurs. This method is not called for the initial render. We can use the new useEffect() hook to simulate componentDidUpdate(), but it seems like useEffect() is being ran after every render, even the first time. How do I get it …