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

224
Vistas
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 Respuestas
Responde la pregunta

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 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