Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
replace jsx elements in rendered tree

I want to replace element in jsx e.g react tiny Link npm is rendering this

<div>
<header>
header
</header>
 hello
 <footer>
 footer
 </footer>
</div>

and i want to replace header and footer tag with div like this

<div>
<div>
 header
 </div>
hello
<div >
footer
</div>
</div>

react tiny link here and Im working on accessibility in React application its creating this above code but this deque extension raising issue that you can't have multiple header on same page. the first main header is created by me Im also having other issues like role="rowgroup" which are on other pages"

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Normally you don't want to replace a semantic html element such as a <header> with a non-semantic element such as a <div> or <span>.

A <header> typically contains the main navigation to a page and is displayed at the top.

The official HTML 5.3 spec for <header> does not say that you can't have more than one <header>, although it would be unusual and not a best practice to do so.

However, a <header> has a default role of banner as long as it's not a child element of an <article>, <aside>, <main>, <nav> or <section> element, and the banner role says:

Within any document or application, the author SHOULD mark no more than one element with the banner role.

The key here is the word "SHOULD", meaning it's recommended that you shouldn't have more than one banner but it's not strictly prohibited.

So with all that being said, if you are trying to change your <header> to a <div> because an accessibility tool is flagging it as an error, then that tool is incorrect. If the tool is marking it as a warning or something you should manually verify, then you can ignore the warning if you have a good reason for having two <header> elements.

I know this doesn't answer your main question of how to change it, but it might make your question irrelevant if you don't need to change it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda