Import in body of module; reorder to top. code example

Example: Import in body of module; reorder to top.

you will get this error if you have declared a variable in between your imports,

import React from 'react';
import axios from 'axios';

const URL = process.env.REACT_APP_API_BASE;

import demoXLXSFile from '../../assets/others/Demo.xlsx';
import './student.list.styles.scss';


declare variables after importing everything,

import React from 'react';
import axios from 'axios';
import demoXLXSFile from '../../assets/others/Demo.xlsx';
import './student.list.styles.scss';

const URL = process.env.REACT_APP_API_BASE;

Tags:

Misc Example