How do I import a bit component into another bit component #4447
Answered
by
debs-obrien
debs-obrien
asked this question in
FAQ
-
If you have a local component in the same workspace and you want to use it in another component then you can't use a relative path as Bit will not allow it so how do you import it so you can use it? |
Beta Was this translation helpful? Give feedback.
Answered by
debs-obrien
Jun 18, 2021
Replies: 1 comment
-
You need to import the component as if it was coming from your node_modules folder. In the workspace UI on the overview tab of your component you will see a Package Name with your components orgName/scope/componentID. You can copy this and then add it to the from part of your import statement:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
debs-obrien
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to import the component as if it was coming from your node_modules folder. In the workspace UI on the overview tab of your component you will see a Package Name with your components orgName/scope/componentID. You can copy this and then add it to the from part of your import statement:
import { Button } from '@learn-bit-react/base-ui.ui.button'