A
A
Andrei Smirnov2017-03-05 10:50:02
React
Andrei Smirnov, 2017-03-05 10:50:02

How to import my controls in create-react-app?

I took create-react-app to learn how to work with it. I started making a simple portal for my needs, and the first thing I came across was how to import my own controls without long relative paths:

/src
      /Controls
          /Button
     /Views
         index.js  <-- как написать import Button from '../Controls/Button' без '..'?

Tried
import Button from 'src/Controls/Button', import Button from '/src/Controls/Button'
and so on, but nothing helps.. it seems to only work with relative paths.
I do not want to do eject yet. Are there solutions to this issue? Or am I worrying about relative paths for nothing?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-03-05
@maxfarseer

My opinion: take a steam bath in vain.
If so, a solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question