Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!