Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent component API desgin #579

Open
domtronn opened this issue Jun 22, 2020 · 0 comments
Open

Consistent component API desgin #579

domtronn opened this issue Jun 22, 2020 · 0 comments

Comments

@domtronn
Copy link
Contributor

We have some components that have optional 'features', for example, optional progress bars or optional images. I think we should have a consistent approach to designing these kinds of APIs, and my initial food for thought w.r.t. options are the following;

  1. Opt in - i.e. showFeature={true|false}, explicitly asking for the feature
  2. Opt out - i.e. hideFeature={true|false}, explicitly remove the feature
  3. Implicitly - i.e. infer whether to render component based on presence of data

Regardless of which one we choose, I think we should follow one approach for all components and refactor the existing ones accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant