Category "javascript"

How to find declaration for my typescript/react module?

I am very (very) new in frontend technologies, specially react and typescript. My issue come when trying to do a simple thing that is to use a react component

is it possible to run a rollup plugin without an input file (in a multi bundle instance)?

I have a situation where I am bundling multiple files via rollup cli an example of this is available in documentation. I export an array of bundles like so: e

Do I need to unsubscribe from an Observable if the Observable is finished with?

Let us say I have an Observable (hot, doesn't complete), and I subscribe to it. Ordinarily when I am finished with the Subscription I have to unsubscribe it to

Benefits of using autoloader with js modules?

In my workplace I've been told by my supervisor to use autoloaders instead of using many import statements since it's slow! First of all, based on my research t

How to sort data in ascending or descending order in Reactjs?

I have products data which I am importing in my displaycomponent. For each product in JSON I am using .map() to display the content. Now I want to sort the prod

How can I use optional chaining with arrays and functions?

I'm trying to use optional chaining with an array instead of an object but not sure how to do that: Here's what I'm trying to do myArray.filter(x => x.testKe

Folding JSON strings to send in header variables - Mailgun

I'm trying to use the JS Mailgun API to send emails. Have it working fine, until I throw template variables into 'h:X-Mailgun-Variables' like so, where jsonStri

Angular: How to store FileReader content in a variable or an array

I'm so confused about this but is there a way to store FileReader content into a variable or an array as it is, because I need that content into another compone

Check If Linked List is Palindrome in JavaScript

I have written the following function in JavaScript to check if a singly Linked List is a palindrome. However, I'm failing 2 out of 10 tests, and I can't figure

Why can't I deploy my next.js app to port 80?

I never deployed any project before and I'm currently running with an issue while deploying a next.js app to godaddy. I uploaded my next.js app to the public_ht

"[Vue warn]: Invalid Component definition" in Jest when importing an SVG in Nuxt JS

I have an error exclusively in my Jest unit test when I import an SVG in the component being tested: console.error node_modules/vue/dist/vue.common.dev.js:630

JavaScript triggered redirect not working on site opened in facebook webview

Opening our ecommerce site from within the Facebook app on Android, opens the page itself in a Facebook web view. When performing the purchase, an external app

Issue with Web3.js, try to call he contract to see the state

Hi everyone! I tried to make a call to the state of a contract developed on truffle, using web3.js in React, the problem is this, when I try to see the price of

How to loop and display array of objects and their nested arrays

I need help, I got stuck on objects with multiple nested arrays. I have a json file which consists of object, that holds array of objects, and these objects hav

var functionName = function() {} vs function functionName() {}

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consiste

Emit data from stencil component to ReactJs component

How to catch emitted data in stencilJs component in ReactJs component? I've created a CustomInputStencil component that has a prop of onChange that accepts a fu

Edit Product with images using React-Dropzone

When creating a product I use React-Dropzone but when editing I intend to use it in the same way. I would like that when editing the product, the images that ar

Button Click to return to the same page with same input parameters

I want users to navigate back to the same page after the button is clicked on the page. If the user URL is https://localhost:xxx/Inventories/Index/38?custID=38&

Datatables handle null ajax response?

This is my datatable code: table = $('#datatable-buttons').DataTable({ lengthChange: false, pageLength: 25, order: [ 0, 'desc' ],

HTML onchange event sometimes fires twice on input checkbox element

This happens to me in Chrome 79.0. CodePen replicating the issue: https://codepen.io/puckowski/pen/eYmEbVz I have a basic input element which looks like: <