first of all, I can not use the “create-react-app” command in the current project. so here I am trying to add my react code into a plain HTML file. Here are my codes for HTML and js files. can anyone tell me why my hooks and setState don’t work properly? Please guide me to solve it. my like_…
helmet.js custom options for one middleware while enabling others
I want to set some custom options for one of the helmet.js middlewares but I don’t understand if by doing so the other middlewares are enabled or I have to enable them explicitly ? From helmet.js docs: Should I add app.use(helmet()) before the above code ? Answer app.use(helmet()) includes all of Helmet…
How to properly execute logic right after setState updates the react functional component state?
Currently, I am making a profile page where it will initially fetch the user profile details from an API endpoint. I want to have a loading indicator representing the fetch status. I am now using useState hook where I store a boolean value for isLoading state. However, after reading the documentation about us…
How to use querySelectorAll only for elements that have a specific child element?
I’d like to process all tr that contain a td, but can only find contain queries for attributes and content; not elements. Is the latter possible with a single query? Answer Not directly, but you can use filter to get the appropriate rows
Splitting an Ordered List into two columns
So I have been trying to split my ordered list, which contains skill names, into two columns, but the columns are not on the equal level. I tried to fix it by adding padding and margins as such, but it doesn’t work. Here’s my code – The Output – Contains output of given code snippet as…
Vuetify table not showing data
I am new to the vuetify and having a headache with displaying table. I searched others and tried them on mine but its not showing… shows data on dev tool I can see my data with dev tool but it wont show on the table ;~; Here are my codes Vuetify Table Code BoardList.vue script part api/board.js I tried …
How to replace text with a random array element?
I am trying to replace text with a random element in my array. When the user clicks on the text itself, the word should change to one of the elements in my array. I am having trouble with the function that lets me do so. I have text and wrapped span tags (named “hare”) around words that I want to
increment a value in an array if a match is found
so i’ve got the following array created using and with the following I’m trying to compare it to that gives me what a person has voted. what I’m trying to do is if a user votes something ex: movie#3 I want to look through movie.json and increment voteCount by one for movie#3. I’ve trie…
How can i get the number of times a word is in an array?
Suppose i have an array of objects: const arrayOfItems = [{id: 1, title: “Pizza”}, {id: 2, title: “Pizza”}, {id: 3, title: “Pasta”}] How can i get the number of times Pizza is in the array? I am building a simple add to cart functionality in JS where i want to show how many…
React does not update page when manually entering a URL
I have this issue where React does not update/refresh the page when manually entering a URL on a tab that already has the website open. I have a live demo of the website here: https://dpldmuafup7cw.cloudfront.net/#/ When on the home page you should be able to click a link to a film, and then enter the ID of a…