Real-Dev-Squad / todo-action-items

A running list of todo items for Real Dev Squad site
MIT License
4 stars 8 forks source link

Share React components between three NextJS apps #102

Open vinayak-trivedi opened 2 years ago

vinayak-trivedi commented 2 years ago

We have a lot of components which are same in all three sites built on next js, we need to find out a way to share the code between all three sites, instead of making it separately

Different approaches which we can use to get the desired result.

Approach 1 - creating a component library

Approach 2 - Use a tool like bit

There are certain tools like bit which allow to reuse the code in different repos, the installation in this works the same as npm packages, one disadvantage of this is that it is not completely free.

Approach 3 - use git submodules

vinayak-trivedi commented 2 years ago

We can use git submodules for it, it allows us to share code between multiple repos, read here to get more details

vvaibhavdesai commented 1 year ago

@vinayak-trivedi if we do submodules this is what will need to do. But are we wanting to do this kind of repo structure changes ? image