Category "javascript"

How can I store data from JS into a MySQL database

First things first, I'm new to the forum, anything I write that isn't concise or just flatt out adjective let me know! I'm developing an app that can retrieve d

Updating create-react-app to latest version breaks async tests

I have an issue, I have recently upgraded my version of react to use react-script version 5.0.1 from version 4.0.3. Doing the instructions as per https://github

How to return the response from an asynchronous call

I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to return the value from the callback, as

React Hooks - Using useRef without direct access to HTML Element Code?

With React I'm inside of one repository, and the HTML elements are loading from another repo, which I watch for using pageLoaded. Inside updateHeader there is j

React Native Animated setValue() problem?

Actually I'm trying to set value of the animation with setValue() after Animated.timing() is finished and want to use this updated animated value then in a loop

JEST: My Isolated module function depends on a function found on the same module. After mocking, it still relies on the original implementation

I have abc.js const a = (a)=>{ return (b(a) + 1) } const b = (num)=>{ return(num + 1) } module.exports = { a, b } When I do my test for

Problem with MERN app on netlify and heroku (CORS)

This my first question but I completely have noo idea what to do :/ I learn javascript technologies. I've written my MERN app where I handle login and register

Cypress: Add option to allow LocalStorage

The following facts: page 'X' Open -> cy.visit('/x'); check checkbox 'A'-> cy.checkCheckbox('A'); close browser or reopen page ?????? check if checkbox 'A

How to enable HTML input field from Javascript

I'm using localStorage to save string so the user could enter title and it will be saved for the next times. I want to add a button that will delete the display

Integrate mapbox with fabric js

I am using fabric.js for html 5 interactive canvas app and I'm tryna to do an integration with mapbox, basically putting the map inside a fabric js element such

Can't parse excel date to string with xlsx in a util function javascript

I am trying to read an excel document which has a datetime column.Uploading it to the website,instead of date column i get those numbers which represent the tim

getServerProps does not fetch the data

I am working on an real estate site through a tutorial since I am learning NextJs and for apartments filter it uses getServerSide as common, the code I use is :

How to invoke a machine with context of the machine that invokes that machine?

Firstly, here’s the code. I need to fix. Basically, there are two machines: currentStateMachine: currently, I want to change the state manually (running s

Is there a way to the limit number of API response data display on HTML?

My Get request returns over 1050 pages in the console. I am trying to display in HTML and when I do, the result covers my page and the search bar. Is there any

Django update bootstrap modal not updating untill refresh

Django bootstrap modal form works when i create new data gets populated and pop up closes automatically without refresh but when updating success message appear

My react code doesn't work after i import some files

import React from "react"; import { Container, AppBar, Typography, Grow, Grid } from "@material-ui/core"; import Posts from "./components/Posts/Posts";

Head (next/head) throwing error in NextJS

I am trying to add head to a page in NextJS. As per the documentation I have used next/head to add <head>. However, the code block for using next/head is

knex migration - 'ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I have a knex chema migration to create a table, with the line - exports.up = async function(knex) { return knex.schema.createTable("newTable", table => { ta

knex migration - 'ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I have a knex chema migration to create a table, with the line - exports.up = async function(knex) { return knex.schema.createTable("newTable", table => { ta

Head (next/head) throwing error in NextJS

I am trying to add head to a page in NextJS. As per the documentation I have used next/head to add <head>. However, the code block for using next/head is