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

225
Visualizações
Expected an assignment or function call and instead saw an expression no-unused-expressions in React?

Line 3:1: Expected an assignment or function call and instead saw an expression no-unused-expressions. This is my first time using 'use restrict" in javascript and I don't know how to fix the rule that is against.

My Nav.js file in react

import React from 'react';

'use strict';
function Nav() {
  return (
    <nav>
        <ul>
            <li> About </li>
            <li> Shop </li>
        </ul>
    </nav>
  );
}

export default Nav;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

From MDN:

To invoke strict mode for an entire script, put the exact statement "use strict"; (or 'use strict';) before any other statements.

Since you put that string literal after your imports, it is just a string literal expression. It doesn't trigger strict mode. It doesn't do anything (because you don't assign it / pass it / etc).

Move it so it is the very first line of your JS.

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