Efficient Component Management in React using Bit.dev

74 views Asked by At

Suppose I have a React project with the following structure involving bit: I have a bit folder at the project's root level. Inside this bit folder, I initialize bit, creating a bit ecosystem.

I'm wondering if it's considered a best practice to directly import components from the bit folder when they are needed, without installing them using yarn. This might involve using a tool like Turbo Repo. I'm facing difficulties with my current approach:

whenever I update a component in the bit folder, I need to perform a bit tag and bit export it. Subsequently, I must reinstall the component using yarn with the latest version from the bit.cloud. This process is cumbersome. Would it be more effective to import components directly from the bit folder, eliminating the need to consistently install the latest yarn version of the component in the project root?

I've already exported it to the scope, making it easily consumable for others. My aim is to avoid the repetitive installation of components whenever their versions are updated in my React project.

here is my project structure:

my structure folder

if best practice, it's acceptable to add the 'bit' folder from a React project to the .gitignore file?

0

There are 0 answers