Skip to content

Commit

Permalink
Sam's suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
  • Loading branch information
oliviertassinari and samuelsycamore committed Nov 1, 2022
1 parent 1efd360 commit 5da6165
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/data/material/guides/api/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Nested components inside a component have:

- **Boolean**

- The default value of a boolean prop should be `false`. This choice allows the shorthand notation For example an input is by default enabled: How to name the prop that controls this state? It should be called `disabled` because:
- The default value of a boolean prop should be `false`. This allows for better shorthand notation. Consider an example of an input that is enabled by default. How should you name the prop that controls this state? It should be called `disabled`:

```jsx
<Input enabled={false} />
<Input disabled />
```

- The name of the boolean, if composed of a single word, should be an adjective or a noun and not a verb. This is because the prop describes a state. For example an input prop can be controlled by a state, which wouldn't be called with a verb:
- If the name of the boolean is a single word, it should be an adjective or a noun rather than a verb. This is because props describe _states_ and not _actions_. For example an input prop can be controlled by a state, which wouldn't be described with a verb:

```jsx
const [disabled, setDisabled] = React.useState(false);
Expand Down

0 comments on commit 5da6165

Please sign in to comment.