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

Adjust prop naming conventions and defaults for easier use with JSX #82

Closed
j-f1 opened this issue Apr 13, 2018 · 1 comment
Closed

Adjust prop naming conventions and defaults for easier use with JSX #82

j-f1 opened this issue Apr 13, 2018 · 1 comment

Comments

@j-f1
Copy link

j-f1 commented Apr 13, 2018

I’ve noticed that many if not most boolean props in this library default to true. For example, in <Box />, all of the props except padded default to true. This makes it more difficult to adjust their values. For example, to render a horizontal, invisible box, you need to do this:

<Box vertical={false} visible={false} />

However, if the API was changed to use false props by default, this could be written this way instead:

<Box hidden horizontal />

This saves on typing (no ={false}) and is clearer IMO since you specify which features to enable, instead of which ones to disable.

What do you think?

@kusti8
Copy link
Owner

kusti8 commented Apr 22, 2018

Seems like a good idea, but to change the name, I have to create an object mapping to translate it into libui terminology which I would rather not do since it can get really unwieldy.

@kusti8 kusti8 closed this as completed May 2, 2018
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

2 participants