Skip to content

Commit d1c1c30

Browse files
davidjbSunil Pai
andauthored
Clarify preferred "props default to true" expr (#495)
* Clarify preferred "props default to true" expr The current text is ambiguous without reading further into the paragraph -- until I re-read this text, I was trying to avoid both types of syntax because it seemed to imply that it wans't recommended (eg "props default to true" --> "we don't recommend using this"). * Update jsx-in-depth.md Co-authored-by: Sunil Pai <[email protected]>
1 parent 56cea09 commit d1c1c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/jsx-in-depth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ If you pass no value for a prop, it defaults to `true`. These two JSX expression
227227
<MyTextBox autocomplete={true} />
228228
```
229229

230-
In general, we don't recommend using this because it can be confused with the [ES6 object shorthand](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015) `{foo}` which is short for `{foo: foo}` rather than `{foo: true}`. This behavior is just there so that it matches the behavior of HTML.
230+
In general, we don't recommend *not* passing a value for a prop, because it can be confused with the [ES6 object shorthand](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015) `{foo}` which is short for `{foo: foo}` rather than `{foo: true}`. This behavior is just there so that it matches the behavior of HTML.
231231

232232
### Spread Attributes {#spread-attributes}
233233

0 commit comments

Comments
 (0)