Yes, I have checked the other posts. I didn’t have this issue when building normal html/css/js project but I need bootstrap for this project and I think it is interfering somehow with my script, but I do not know how. On scroll, I want color to change from transparent to x. I also want to change all nav…
Tag: javascript
Could not make POST request to add comments to my backend server
I am new to express and router. When I try to add a comment to the database, the console returned the error (“Post 400 Bad request” and “Uncaught in Promise”). I’ve tried many solutions but it doesn’t work. I think it is to do with my routing. Below is my profilesRouter.js …
How to specify the type for the return of useNavigation
I’m having some diffuculties specifing the parameters for a function (onError) that receive the return of a useNavigation()) TS playground Answer I have not personally worked with @react-navigation, so I’m going by the types only, but it looks like useNavigation, when called without type parameter…
How to clear/reset mocks in Vitest
I have a simple composable useRoles which I need to test My approach of testing it is the following And useStore is just a simple function that I intended to mock The first test runs successfully, it has all the mock values I implemented but the problem is that it’s not resetting for each test (not rese…
How can you strike through a variable in Javascript?
I want to strike through part answer[i], but not wordArray[i]. How should I go about this? Thanks. Answer Strike though a variable sounds weird, do you mean to strike a text (string)? In that case you have text-decoration: line-through; (see more about text-decoration) If that’s the case you can wrap yo…
Created an object in my index.js file, how to make it available in a router file?
I have an index.js file where I: initialize my Express app instance include a router.js file that defines a POST endpoint create a Socket.IO object code as follows: At the POST endpoint in router.js, I want to use the Socket.IO object like this: But this gives me the error: How do I make the io object availab…
Can’t focus on object before it is hidden (react)
I have this input that when focused opens up a select. The behavior I want could be achieved with a simple select but I wish to further add functionalities that a simple select does not allow. Simply put when you have the ‘box’ focused, you can view the options, when you don’t you cannot. I …
Collapsible direct drop down menu with JS
I’m trying to create a drop down menu that exposes the content when it’s hovered over. I didn’t know how to do it myself so I referenced W3school’s collapsible tutorial’s code. In the tutorial the collapsible opens when clicked on, and I was able to make it open when hovered over…
React – Error while rendering child component with prop passed from parent component
I have a problem while creating my react app. I’m fetching data from CoinGecko API to build a crypto tracking app, but when I pass the data prop from the parent App.js to the child Info.js. When I try to render the page it gives me Info.js:45 Uncaught TypeError: Cannot read properties of undefined (read…
Adding Autoplay To Video Element With Javascript
I want to have my video automatically play and loop for me when the user scrolls to a specific area on the video element. I’m aware that I can use a JS observer to do this: however, how do I use JavaScript to add and remove ‘autoplay’? What I want my default code to be: What I want to happen