the error in the console is : ERROR in [eslint] src\services\orders.js Line 9:3: Expected an assignment or function call and instead saw an expression no-unused-expressions
Search for the keywords to learn more about each error.
app.jsx
import { useEffect, useState } from 'react';
import './App.css';
import { Table } from './components/Table';
import {ordersService} from './services/ordersService'
function App() {
const [orders , setOrders] = useState(null)
useEffect(() => {
async function fetchData() {
const ordersData = await ordersService.query();
console.log(ordersData);
}
fetchData();
}, []);
return (
<div className="app">
<Table orders={ orders } />
</div>
);
}
services\ordersService.js
export const ordersService = {
query
}
function query(sortBy) {
return Promise.resolve(gOrders)
}
const gOrders = [{
"order_ID": 2790846857303,
"name": "#38777",
"total_refunded": 0,
"created_at": "2020-11-23 23:27:52",