Menu
ComponentKit LogoComponentKit
DocsInfrastructureAPIGitHub
ComponentKit LogoComponentKit
  • Docs
  • Infrastructure
  • API
  • GitHub
  • Getting Started
    • Getting Started
    • Philosophy
    • Uses
  • Reference
    • Component API
    • Composite Components
    • Views
    • Responder Chain
    • Actions
    • State
    • Scopes
    • Component Controllers
    • Lifecycle Methods
    • Debugging
  • Animations
    • General Principles
    • Initial / Final Animations
    • Change Animations
    • Legacy APIs
  • Collection Views
    • Overview
    • Basics
    • Changeset API
    • Gotchas
    • Dive Deeper
  • Best Practices
    • Never Subclass Components
    • Avoid Overrides
    • Indentation
    • Avoid Local Variables, Use Const
    • Avoid Single Use Constants
    • No Underscores
    • Pass in Actions
    • No Side Effects
    • Pass in Immutable Objects
    • Components Can't Be Delegates Directly
    • Avoid Excessive Branching
    • Check for Nil
    • Avoid push_back
    • Under 300 Lines
    • Avoid Width 100%
    • Use Designated Initializer Style
    • Break Out Composite Components
    • Keep Controller in Component
  • Appendix
    • Why C++
    • Advanced Views
    • Component Context

Under 300 Lines

Long files are the enemy of maintainable code. Keep component files under 300 lines total. If you're tempted to go above that size, split it into separate CKCompositeComponent 's.

Previous
« Avoid push_back
Next
Avoid Width 100% »
Facebook Open Source Logo
Copyright © 2021 Facebook, Inc.