Skip to content

[Discussion] No mutually exclusive boolean props #7220

Description

@roryabraham

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Coming from here, I'm proposing a new code style guideline: "No mutually exclusive boolean props".

What I mean by this is that we should ban the use of boolean props that are meant to be mutually exclusive: i.e: instead of having small, medium, large each be their own separate boolean props, create a single size prop that's PropTypes.oneOf(['small', 'medium', 'large']).

This prevents unpredictable behavior in the event that two mutually exclusive boolean props are passed as the same time.

View all open jobs on GitHub

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions