I have a fetch request for my sample application, that receive a json. I’ve mapped this json and i can potentially display over 100 elements with a single request. The problem is that i want to implement a load more button to make the page more simple to read and load (for example i want to display 20 i…
Replicate element in React
Hello thanks for the help, with the following code in react I want to replicate the click button every time I click on it. Currently nothing happens, but if the console shows that the array grows. Here the sandbox: https://codesandbox.io/s/charming-glitter-0ntxmj?file=/src/App.js Answer Updating a local varia…
How to split a string into two and output them as two different blocks?
There is a React component – ‘function Product (props) { } export {Product} Question: The variable prod_status: status can contain several values (for example, “new,promotion”, if so, you need to split it into two words and create a separate block for each, since now the block comes wi…
extract url and name attributes from the given string
the format of the input string is >> [https://thisisurl.com] This is Name how to extract “https://thisisurl.com”, and “This is url” attributes from it where the url attribute is given in brackets [???] and remaining text is the name attribute I want a function that can do this ta…
How to log how many possibilities fulfil the if statement javascript
I’m trying to log how many items from the array fulfil the condition. the output I’m looking for is : 6 (because 6 of the numbers are equal or greater than 8) tried let count = 0; for (let i = 0; i < grades.length; i++) { if (grades[i]>= 8){ count++ } Answer
React: Change / Iterate an Element Color Every Second
Coding World Say I have the above, I want to iterate through each element one at a time and turn the colour to gold. So at any one time only one of the words should be gold. First Hello should be gold, then Coding should be gold and then World should be gold. I tried to do it so it
How to avoid duplicate items in a drop down list to display?
I would like to create a drop-down list and retrieve the elements from a webService. My problem is that I would like to avoid displaying duplicate items because I have 9999 items. Here is the JSON file. enter image description here Do you think it is possible to do this? Because, I have no idea how to program…
I need 2 different buttons, to create new folder and create a new PDF in that folder
I’ve been struggling to build a specific weekly stock system reports. So to give you a basic overview, I have a mastersheet that I want to generate reports from, triggered by an UI button. The first step however is to create a folder for that week to place the PDF’s in. I can create the folder, an…
Why am I getting undefined prop?
Below is my Header component in react: I have used ContextAPI for efficient state Management.CryptoState is used for this purpose.I have imported the state in Header and getting the necessary props using object-destructuring. Below is my Context-file: I am getting this error in Header component:Header.js:8 Un…
NextJS render content from a different page
I’ve two routes like, app/products => pages/products/index.js app/products/1 => pages/products/[page].js Here both app/products and app/product/1 will render the same content (same product items), is it possible to render app/products/1 content in app/products without writing duplicate code? I cou…