Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

321
Visualizações
How to show 3 components in react header? Seems like they are currently mutually exclusive

I'm trying to show 3 components in react header so that the UI will be like so: React header UI The header should include 3 components which are (1) Cash balance: 123, (2) Asset balance: 123 and (3) the notification component as you can see on the right. Additionally, (1) Cash balance: 123, (2) Asset balance: 123 should be in the middle of the header bar.

However, seems like the header can only show 1 component now, whenever I add a new component, for example,<h5>Hi</h5>to the header with the code like below:

return (
      <Fragment>
      <header className={classes.root}>
        <h5>Hi</h5>
      <HeaderNotification />
      </header>
      </Fragment>
  );

The notification will be gone, and shows this:Error May I ask why would this happen and how could I show 3 components in react header? Much appreciated.

To supplement, JSS styling for root is

root: {
    "position": "fixed",
      "top": "0",
      "left": "0",
      "width": "100%",
      "height": "6rem",
      "backgroundColor": "#8a2b06",
      "color": "white",
      "display": "flex",
      "justifyContent": "space-between",
      "alignItems": "center",
      "padding": "0 10%",
      "boxShadow": "0 2px 8px rgba(0, 0, 0, 0.25)",
      "zIndex": "10",
      "margin": "0px 260px 0",
  }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The HeaderNotification is most likely present, but being pushed down by the h5-tag.

You could check this in the element inspector in your browser.

Try changing the width and height of the h5-tag and the HeaderNotification, or changing them to display: inline

return (
    <Fragment>
    <header className={classes.root}>
        <h5 style={{width: '10%'}}>Hi</h5>
        <HeaderNotification style={{width: '10%'}}/>
    </header>
    </Fragment>
);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda