I need help with my project I want to add a dynamic option to the PayPal payment process. ( change the value to be dynamic ) the default option is value: ‘0.01’ and the dynamic payment in my project is cart.subtotal.formatted_with_symbol I try to add [const {amount} = cart.subtotal.formatted_with_symbol;] this line to try to change the value to value: amount
Tag: frontend
Generating random array in reactjs
I’m trying to generate a specific size random array in reactjs everytime a user hits a button. The code to generate the array is the following: This code seems to work when I test it separately. I can call it how many times I want and it will still work. However when I use this function with a simple reactjs
directive to enable keyboard-navigation (using tab)
Hi I have this div which is skipped when we press tab, other UI elements come into focus but not this one, Which directive do I need to add to this so that it comes into focus when we navigate UI using keyboard Answer There are html elements without tabindex enabled by default, and the div element is one of
Using filter with slice array methods not working
I have a search input that I use to filter an array of users that are shown in a table. This table includes pagination so I’m using .slice to get 10 users to show on the table per page. For some reason, the search filtering works if I’m on page 1 (guessing because there’s no slice on page 1?); after
Does “undefined” occupy memory in javascript?
In this situation var foo; Will “foo” point to somewhere in the memory that contains the value undefined? Does undefined occupy memory in javascript? Does undefined mean that there is no memory address assigned to a specific label? Answer There’s two parts to your question. The variable itself and multiple copies of undefined value. First, variables can take space in
I am developing a theme for wordpress, also I am a beginner. As I was coding, the body tag in my css wouldn’t work. What can be the possible reason? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question Coding it in VS code. If you need for info, please let me
how to reset color grid?
I am creating a simple etch-a-sketch game. currently on hover it colors in black. I am trying to use a button to reset the colors back to white. However, i can’t get the button to function with an event listener, if i add an alert it displays the alert but nothing else. Please guide me and supply a documentation that
React hook form method – setValue – doesn’t work
I have some clearable select, and I want to reset the applets field in state to an empty array. the problem is that clearing the selection on UI with setValue(“applets”, []); not working for some reason, and I don’t understand why, and how to do it without reset method, which resets the whole state, not just single property as I
Customize the display in an input [Vue.Js]
I have an input that must contain values according to the selected checkboxes, and I would customize the display on the input according to the checked checkbox. I have initialized a watcher that updates the v-model of my input but the display is the following: my input : [Jhon,Eliott] While I would like to put a space in place of
How can i display an image from mongodb in binary with reactjs
This is my model in MongoDB And i was able to display it in the backend with EJS like this However when i try to display the image in the frontend with reactjs i cant, this is what i’ve been trying Answer I would start with this mongo document: Then you can treat the image everywhere as a simple string,