1

I have a custom React Hooks, named bar at foo directory, and I import it with the way below:

import * from "../../foo/bar";

and the question is, how can I do it with the way:

import * from "@foo/bar";

to avoid find the directory boring.

zhyd1997
  • 145
  • 3
  • 15
  • https://stackoverflow.com/questions/42711175/what-does-the-symbol-do-in-javascript-imports – artanik Mar 21 '21 at 10:17
  • 1
    There are several ways to achieve this, I personally use TSConfig `paths`: https://www.typescriptlang.org/tsconfig/#paths – nbokmans Jun 11 '21 at 09:42

0 Answers0