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

154
Visualizações
How do I combine a string + javascript for a className?

How do I combine a javascript variable with a string? Do I have to concat the variable?

{ /* JSX + Bootstrap */ }
<div className={s.container} + "col-md-offset-4 col-md-4 well">

Edit: Thank you for the help. Here's the error I'm getting

<div className={'col-md-offset-4 col-md-4 well' + s.container}>
// Error: Unexpected string concatenation

Thank you for the suggestions... Here's the error I get when I follow these docs http://eslint.org/docs/2.0.0/rules/prefer-template

Module build failed: SyntaxError: JSX value should be either an expression or a quoted JSX text (23:23)

  21 |     return (
  22 |       <div className={s.root}>
> 23 |         <div className=`col-md-offset-4 col-md-4 well ${s.container}`>
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

@Poke and @Andrew Li deserves credit for figuring this one out. You need to follow the docs but also put it inside javascript with the curly brackets

<div className={`col-md-offset-4 col-md-4 well ${s.container}`}>
over 4 years ago · Santiago Trujillo 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