React Best Practices

Sorting import statements

Sorting import statements

It is suggested to keep relative imports at the bottom and aliased/library imports at the top.

For example, this:

1import React, { Component } from "react";
2import Toolbar from "../Toolbar";
3import SqlOutput from "./SqlOutput";
4import Fade from "react-reveal/Fade";
5import debounce from "lodash/debounce";
6import Editor from "../Editor";
7import sqljs from "sql.js";

Should be arranged like this:

1import React, { Component } from "react";
2import Fade from "react-reveal/Fade";
3import debounce from "lodash/debounce";
4import sqljs from "sql.js";
5
6import SqlOutput from "./SqlOutput";
7import Toolbar from "../Toolbar";
8import Editor from "../Editor";
9