What are some benefits of Container-Presentational pattern?

Technology CommunityCategory: React NativeWhat are some benefits of Container-Presentational pattern?
VietMX Staff asked 3 years ago
  • Less code duplication. Because you are forced to move all the layout components out as separate presentational components, you can directly reuse them instead of copy-pasting the code in every page.
  • Presentational components are essentially your app’s View layer. Hence, you can change the styling without touching the app’s logic.
  • Better separation of concerns. You understand your app and your UI better by writing components this way.
  • Better reusability. You can use the same presentational component with completely different state sources, and turn those into separate container components that can be further reused.