Skip to content

Commit

Permalink
Docs: Clarify components capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jul 9, 2018
1 parent 8531576 commit 4263e55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/reference/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ class Earth {
Earth.humans = [];
```

All `@wordpress/element` Components, including stateless function components, should be named using Class Definition naming rules, both for consistency and to reflect the fact that a component may need to be transitioned from a function to a class without breaking compatibility.

**Examples:**

```js
class MyComponent extends Component {}

function MyComponent() {}
```

#### Constants

An exception to camel case is made for constant values which are never intended to be reassigned or mutated. Such variables must use the [SCREAMING_SNAKE_CASE convention](https://en.wikipedia.org/wiki/Snake_case).
Expand Down

0 comments on commit 4263e55

Please sign in to comment.