Category "javascript"

React - .map returning not a function?

I was following this example: https://reactjs.org/docs/faq-ajax.html But my code is returning weather.map is not a function? function App(props) { const [wea

Why does a checkbox get checked after another checkbox above gets removed?

I have an array of my clients' pending requests that I iterate through, creating a div with relevant information for each pending request. Within each div, ther

Shopify asset not loading

I am trying to include a JavaScript file (named StoreLocator.js) from my Shopify assets by using the URL filters as explained in the Shopify documentation (see

question regarding max value in an array with recursion in JavaScript

Currently, I was able to get the following function to retreive the max value from an array through recursion const max = ([a,...rest]) => !rest.length || a

code ERESOLVE when running the command npm install

I'm new to ReactJS and tried to run a code in VS Code using npm install command and this error pops up: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resol

In SvelteKit, is there a way to cancel a popstate event if user state isn't saved?

I have a component that allows a user to edit their state. This triggers a notSaved variable. I have a beforeunload event handler to handle reload and exiting t

How to define common query params in Redux Toolkit Query

All the endpoints of the API I'm working on, require the same set of query parameters. The user must select these parameters before making requests to endpoints

How to display auth errors with p tag

how to display to user an auth error differently than with alert? For example: User will type a bad password, and a p tag will tell him, that he typed uncorrect

React Modal on deletion of a row in React-Bootstrap-Table-next

I have been trying to implement a modal that will pop up to confirm deletion before a record is deleted in my bootstrap table. I have tried different methods bu

Dynamically add a bookmark on PDF.js Express Viewer

In my web application, I'm using the PDF.js Express Viewer library to preview a PDF file. Despite having read the documentation and made numerous attempts, I am

How to stop the Api icon keep adding when click the buttons?

I have to create a web with two buttons to show each city's information. When I clicked the button the icon would keep adding every each time i click it. I have

I can't add labels to svg path

I want to add a custom-styled label to my object. this is my code of SVG: <svg height="512" version="1.2" viewbox="0

D3.js Arc Diagram - Tapered Ends

I have an arc diagram that is based on this blocks example, and I'd like to taper the ends of the arc path so that they are hidden behind the circles (or at lea

How can I write this function into my existing code, Keep getting a promise rejected error

Hi I am trying to Include the function below into my existing code so that after the users are filter based on matching city they will be filtered by the most m

Should I use useImperativeHandle hook when needing multiple refs

I am building component(ThePieChart) where I need to perform quite a bit of DOM manipulation on its elements. Those manipulations I need to perform in parent co

Code works (mostly). But failure to remove duplicates

Summary: Hey I've got a filter for some data. It's filtering fine but it's not removing duplicate objects. Arguments taken in order: 1. datasource 2. filters (r

Detecting WebView2 vs standalone Edge browser?

I have a page that needs to render differently depending on whether it's being viewed from a WebView2 component (inside another application) or from a standalon

Perform an action after clicking on the link

I'm new to JavaScript, I need to perform an action after clicking on the link. For example, we have two pages A and B On page A, I perform a JavaScript action (

Latest version of iOS Chrome not downloading blobs correctly (pdf)

The below code samples works with: Chrome Android Chrom Windows Safari iPhone Safari Mac Chrome Mac Doesn't work with: Chrome iPhone Sample 1 var oReq = new XML

Laravel Mix HMR Server Does Not Launch

Laravel Mix Version: 6.0.43 Node Version (node -v): 16.13.1 NPM Version (npm -v): 8.1.2 OS: Windows 10 21h2 Description: THIS IS HAPPENING ON A FRESH NEW INSTAL