Skip to content

Tag: reactjs

Change placeholder text every two seconds in React

I’m trying to change the set state value every two seconds and can run in a loop but that does not seem to work with the below logic. Excerpt from my code When I try to console log the state, I get three values at a time after two seconds. How can I set the state every two seconds and

How to render a boolean value in an array with condition

what I’m trying to do is to render every item of the array with the certified value next to it. isCertified is a boolean value in each item of my array I have this error : Error: Objects are not valid as a React child (found: object with keys {name, id, isCertified}). If you meant to render a collection…

Duplicate components in React after click button

REACT Problem – I would like to do something like this to start the function of creating a new component after clicking on the button. Moreover I want the div element with its content to appear every time I click a button. (in my case my own component) For example when i want to create questionnaire and…

Does Next.js SSG support dyamic data?

I am making a webapp using Next.js and have a question regarding the Static generated sites. My webapp is a blog, and requires a path for each blog entry in the database. If I were to statically generate my webapp and host it on Vercel, would the getStaticPaths function update the paths when a new entry is ad…

Why cant I export and use my custom js styles?

This my main class And this is my style class called FoodStyles.js They both are in the same folder but still styles cannot be accessed Answer This could be the solution to your problem: (You need destructuring as done in line 7 for your styles to be used in your file.) With React, which fully embraces the ES…

‘state’ is not defined no-undef

I use a tutorial to learn React and I got stuck pretty quickly. In the tutorial they use this code: And everything works great. But in my case, I get this error: srccomponentscounter.jsx Line 4:3: ‘state’ is not defined no-undef Search for the keywords to learn more about each error. After trying everything, …