Skip to content

Commit 4125c31

Browse files
committed
Described components in the docs in more detail
1 parent 8b7c87f commit 4125c31

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/component/overview.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ A component is just a normal class that encapsulates some logic and possibly ano
44

55
UI is optional and is pluggable from outside of components. Components do not depend on UI, the UI depends on components.
66

7+
Unlike the traditional approach with `ViewModels` and navigation from UI (when a `ViewModel` is passed to a Composable function or a SwiftUI View, etc.), Decompose uses the Component concept for navigation. So the UI is only responsible for displaying the information, and everything else is behind the component boundary. This allows more code to be shared between platforms while keeping the UI layer thinner.
8+
9+
Additionally, this approach significantly simplifies testing. A component can be tested by a unit or integration test, often without instrumentation, which is fast and reliable. Plus, various tools can be used for UI testing, including but not limited to screenshot testing.
10+
711
## Component hierarchy
812

913
<img src="https://raw.githubusercontent.com/arkivanov/Decompose/master/docs/media/ComponentHierarchy.png" width="512">

0 commit comments

Comments
 (0)