Create many forms with loop

Hello I am trying to create several forms from a loop that comes from dynamic elements loaded from the database. However I think I am doing it wrong here is what I have already done. It works more or less but I would like to have the right way to proceed. Thanks in advance submitForm:… Read More Create many forms with loop

Avoid unnecessary component rendering with memo in nextjs

I’am trying to understand react’s behaviour throught nextjs. I have an index.js page with one component Homecard displayed three times and one button that increment a value. Each time I click on button all Homecard components are re-render. index.js import { Homecard } from ‘../components/Homecard’ import { useState } from ‘react’ export default function Home()… Read More Avoid unnecessary component rendering with memo in nextjs

How to associate label with checkbox but not using "for=id"

i have this code: <li><input type="checkbox" id="checkboxThree" value="Alergia3" ><label for="checkboxThree">Alergia 1</label></li> <li><input type="checkbox" id="checkboxFour" value="Alergia4"><label for="checkboxFour">Alergia 1</label></li> <li><input type="checkbox" id="checkboxFive" value="Alergia5"><label for="checkboxFive">Alergia 1</label></li> <li><input type="checkbox" id="checkboxSix" value="Alergia6" ><label for="checkboxSix">Alergia 1</label></li> But I don’t want to use "id" and "for" because I have to do other thing later and I can’t use them. I have see… Read More How to associate label with checkbox but not using "for=id"

Looking to place text over image in React

I have a Splideslide element in react and am looking to move the description text over the image for each element. Currently the code I have is: import {useEffect, useState} from “react”; import styled from “styled-components”; import {Splide, SplideSlide} from “@splidejs/react-splide”; import “@splidejs/splide/dist/css/splide.min.css”; function Popular() { const [popular, setPopular] = useState([]); useEffect(() => { getPopular();… Read More Looking to place text over image in React