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

Default props for boolean flags #164

Open
Mohammer5 opened this issue Jul 23, 2020 · 0 comments
Open

Default props for boolean flags #164

Mohammer5 opened this issue Jul 23, 2020 · 0 comments

Comments

@Mohammer5
Copy link
Contributor

Ok, so the default in the context is not as necessary. All right, yeah I guess there's not really any real harm in having it, other than that there's an implicit default in the Table and an explicit one in the context.

Originally posted by @ismay in dhis2/ui#211 (comment)

I think it would be nice to provide defaultProps for our boolean flags. Right now they're implicitly false as not providing them leaves them undefined.

Providing them increases the coding overhead slightly. But reading the code and its intention is easier, it's type-safe (as we'd not be using undefined but false) and doesn't cause confusion when used together with react's context as that one expects a default value

@varl varl transferred this issue from dhis2/ui Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants