I have a .js file with an array of strings inside. Let’s say one of my arrays has the string “The quick brown fox jumps over the lazy dog”. I can search “The quick brown fox” and it will display the string in my array which has that value. But if I were to search “The quick fox jumps lazy
Tag: reactjs
ReactJS: Unable to get the value from a select dropdown because the value is undefined
I just wanted to make a proof of concept that based on the person’s search text and the option they select from the dropdown it will redirect them to the search engine of their choice. When I hit search it throws an error saying that the selectedIndex is undefined. Is there a syntax mistake I am making that I am
How to get the rect.top and rect.left of an element if it’s mapped in React JS
I am trying to have a gloss effect on some cards when the mouse moves over them. What I need is to move the gloss effect base on the mouse position. The problem that I have is that I can’t get the top and left of the card because they are mapped like this I have tried to use the
React router v6: Protected Routes displaying after logging out
I am attempting to implement a private route in React; the homepage should not be visible until the user logs in. If I restart my frontend, all protected routes are not accessible until the user logs in. However, after the first login, all protected routes don’t seem to be protected; I can logout, the session is destroyed in my database
How to download multiple files from firebase using downloadURL in javascript?
I have this code: but instead of downloading the files it opens them in my browser. The currCart[index] is just the wanted name of the downloaded file. Any suggestions? Answer To download a file, we need to create a Cloud Storage reference to the file we want to download, to do that, you can create a reference by appending child
How can I get the updated data without refresh the page in React?
I have a component with create a blog. It works fine and navigates me to the home after adding the new blog object in the database, but I have to refresh the page to be able to see the updated data. So how can I see the updated blogs after navigation without refreshing the page? Answer In order to update
“Slots” prop does nothing when applied on material-ui Slider component
I am trying to figure out what “slots” prop has to offer to the Slider component in terms of taking control of inner components rendering (track, thumb, etc). I am rendering a simple Slider component as shown below However, not even this simple example is working for me. “Slots” prop is not being processed in any way (root and thumb
How to use map function inside a map function REACT wordpress
i’m creating a wordpress plugin with React – haven’t really ever used React before this, so I’m probably misunderstanding something crucial but this is what I’m trying to achieve: You have a button that creates a question for a quiz and then to every button you can add multiple solutions: The idea is that every Function object has an array
react – how to add multiple lists in options with condition to show one of the lists based on the state?
I want to load multiple lists in options. I want to show list based on the country selected. I can’t seem to figure out either. First I tried to load all the lists and put them in <option> This didn’t work. While I see that the list laods, when I try to type anything from GYDATA it doesn’t show me
Pass array in another array of objects
I have this nested array which I am trying to sum the number in the last arrays individually so it should return 400 for each array also trying to get the average of the total, for example if it is 400 then it is 100%, if 399 it will be 99.99%, the average needs to be from 100% and dynamic