Design components to be configurable through props rather than relying on external context like URL paths or modifying shared UI components directly. This approach improves reusability, maintainability, and reduces coupling between components and their usage contexts.
Key principles:
Example of good composition:
// Instead of modifying Select component directly
<Select
components=
// other props
/>
// Instead of path-based configuration
<BillingCredits
teamId={teamId}
isOrgScoped={isOrgScoped}
/>
This pattern makes components more predictable, testable, and easier to refactor when requirements change.
Enter the URL of a public GitHub repository