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

Suggestion for property names #1

Closed
cheton opened this issue Sep 14, 2017 · 1 comment
Closed

Suggestion for property names #1

cheton opened this issue Sep 14, 2017 · 1 comment

Comments

@cheton
Copy link
Member

cheton commented Sep 14, 2017

The preferPlace listed in the docs is verb + noun, for a better naming convention, noun or adjective + noun is a recommended practice for defining a property in any types (i.e. boolean, number, string, etc.), while verb or verb + noun is usually to define a property in boolean or function type. See following examples:

Noun (or Adjective + Noun)

Name Type
id string|number
title node
activeKey any
activePage number
placement one of: 'top', 'right', 'bottom', 'left'

Verb (or Verb + Noun)

Name Type
show boolean
justified boolean
pullLeft boolean
enforceFocus boolean
mountOnEnter boolean
getDimensionValue function

For this case, I suggest you replace preferPlace with placement, which will look much better.

You can also refer to https://react-bootstrap.github.io/components.html#popover-props for details.

Name Type Default Description
arrowOffsetLeft number | string The "left" position value for the Popover are for the Popover arrow.
arrowOffsetTop number | string The "top" position value for the Popover are for the Popover arrow.
placement one of: 'top', 'right', 'bottom', 'left' 'right' Sets the direction the Popover is positioned towards.
positionLeft number | string The "left" position value for the Popover.
positionTop number | string The "top" position value for the Popover.
title node Title content
seawind543 added a commit that referenced this issue Sep 18, 2017
@seawind543
Copy link
Contributor

seawind543 commented Sep 19, 2017

Fixed at v0.2.0

@cheton cheton closed this as completed Sep 19, 2017
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