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

160
Visualizações
font is not setting bold on router.path even if it is returning true

it is supposed to set bold text on anchor tag but not setting it, not only that it is also removing the first string. can someone please help and explain?

<a className={'mr-5 hover:text-gray-900 '+ router.pathname == '/' ? 'font-bold':''} WebSite </a>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In the comparison what is happening is: first a concat with the text mr-5 hover:text-gray-900 with the router.pathname and then comparing with the /, which will return always false.

In order to fix the issue you need to wrap the ternary in parenthesis:

<a className={'mr-5 hover:text-gray-900 '+ (router.pathname == '/' ? 'font-bold' : '')}> WebSite </a>
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