How do I import a bit component into another bit component #4447
-
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.
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.
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'