Category "javascript"

Matched leaf route at location "/" does not have an element

Matched leaf route at location "/" does not have an element. This means it will render an with a null value by default resulting in an "empty" page //App.js Fi

What is the lifetime of the variables declared inside component file in React?

Consider the React code declared inside LoremComponent.tsx below: const foo = "bar"; export default (props) => { return ( <h1>{foo}</h1>

React hooks: Why do several useState setters in an async function cause several rerenders?

This following onClick callback function will cause 1 re-render: const handleClickSync = () => { // Order of setters doesn't matter - React lumps all state

I wanna make my code better but don't know how at this point. I'd like someone else's opnion to tell me how can I improve [closed]

So a friend of mine asked if I could do a function that compresses strings. That function compresses a string if one character repeats itself

Nunjucks nested for loop sort

I am new to nunjucks. I am trying to sort by a value in the nested for loop. As the sort can only happen in the parent for loop I am unsure how to achieve this

How do I write OnMouseOut so it closes a popup tooltip?

I have this code creating a popup/tooltip when specific text is hovered by the user: function popup() { $('#example').load("example.html"); } I add this

How to solve NPM Install Errors gyp ERR

I've attempted most of what everyone has suggested online and still remain with this error when attempting to install opencv and serialport. I currently have V

Writing an array to a file in javascript [duplicate]

I have an array of 32 strings called "arr" and I'm trying to save it to a file (like a txt file). I'm doing this in javascript because I'm get

How to open an S3 pre-signed URL in another tab?

How do I open an S3 file in another tab and not download it? I have this feature that generates a pre-signed URL. The front-end then opens this URL. However, wh

Change getusermedia stream resolution after it is already created

I have a React app that records the user's webcam I'm implementing a feature to allow the user to change the video resolution. When I create the Media Stream fo

How to upload images file in firebase in reactjs in newest update

I'm having a trouble of how I will upload the images in firebase. So basically I separated the firebase.js file and the imageupload.js file It is something like

get Forbidden resource even when the requested user is admin

Middleware is used to protect the resolver. The middleware checks the role of user and despite the right role of the requested user I cannot access listUser que

Typo3 jQuery OnClick Events

i need some help for my fresh installed Typo3 Website. I want to set new Values within my DataBase via jQuery onClick Event. So i guess i need to make use of th

Input field caret position problem in react

Hey, everybody. I'm new in web dev. I have a task on react to increase days in first part of string in input field by clicking 'ArrowUp' button. In addition mut

Table with fixed width and height for cells, but ability to expand each row as required

I have a 12 column bootstrap table whose content per column varies considerably. Some columns only store a word, while others paragraphs etc. I would like to be

How to make environmental variables equal to ID Values in html

Below is my API reference call. I am using github so I put the key in a seperate file and protected that file using .gitignore. The issue is I have no Idea how

How to create a nested data structure from 2 arrays?

Hi guys I get confused trying to qcheave this, so any help would be great! I have two arrays from which I need a specific object. Source arrays: 1-Types (1D):

(ProcessingJS) Pixelating noise

As the title states, I want to know how to pixelate noise. I am using the code below to optimize performance: var totalXoff = 0.0; var draw = function() {

Always get undefined when using Yup.array().when() with two arrays

I have two arrays and I want at least one of them to be filled before submitting My config: initialValues={{ images: [], current_images: [], }} validati

Svelte - event modifier "once" on form submit not working

Any idea why the once modifier doesn't work on form submitting in Svelte? In the following example: <form action="./" on:submit|preventDefault|once={() =>