Hello everybody We are …

1 minute read

Hello everybody. We are thinking in integrate NX to our react projects and I have a question about the architecture.

Currently we have 3 apps (all of them are in their folder in the apps directory) and we also have some react components in an external library. We are thinking on integrate those ui components on the monorepo, so we created each component as a library (so we can see each component on the depth graph). Is that a good idea? Also, do we need to create a component inside the library? is a bit weird having this structure: libs ui button src lib button button.js Is this the best approach?


How come a library per component? I’d go with a “ui-kit” library with all of the components in it

otherwise that structure is what you end up with, I guess :slightly_smiling_face:

We had an internal discussion about it. If we have one library with all components there, on the depth graph only appears the library, so every small change on one component will re-build all the apps that share that library. Instead, if we have each component on separate libraries, we can change one component and only will re-build the apps where is used