Skip to content

Commit e4728dc

Browse files
committed
coding styles
1 parent 84a3bf0 commit e4728dc

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/LiveComponent/README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ code works identically to the previous example:
361361
</div>
362362
```
363363

364-
If an element has *both* `data-model` and `name` attributes, the
364+
If an element has _both_ `data-model` and `name` attributes, the
365365
`data-model` attribute takes precedence.
366366

367367
## Loading States
@@ -1151,8 +1151,8 @@ Here are a few helpful things to know:
11511151

11521152
### Each component re-renders independent of one another
11531153

1154-
If a parent component re-renders, the child component will *not* (most
1155-
of the time) be updated, even though it lives inside the parent. Each
1154+
If a parent component re-renders, the child component will _not_ (most
1155+
of the time) be updated, even though it lives inside the parent. Each
11561156
component is its own, isolated universe.
11571157

11581158
But... this is not always what you want. For example, suppose a
@@ -1171,9 +1171,9 @@ that it passes into the child:
11711171
```
11721172

11731173
In this situation, when the parent component re-renders after clicking
1174-
"Save", you *do* want the updated child component (with the validation
1175-
error) to be rendered. And, this *will* happen because the system detects
1176-
that the parent component has *changed* how it's rendering the child.
1174+
"Save", you _do_ want the updated child component (with the validation
1175+
error) to be rendered. And, this _will_ happen because the system detects
1176+
that the parent component has _changed_ how it's rendering the child.
11771177

11781178
This may not always be perfect, and if your child component has its own
11791179
`LiveProp` that has changed since it was first rendered, that value will
@@ -1185,11 +1185,11 @@ Again, each component is its own, isolated universe! For example, suppose
11851185
your child component has:
11861186

11871187
```html
1188-
<button data-action="live#action" data-action-name="save">
1188+
<button data-action="live#action" data-action-name="save"></button>
11891189
```
11901190

11911191
When the user clicks that button, it will attempt to call the `save` action
1192-
in the *child* component only, even if the `save` action actually only
1192+
in the _child_ component only, even if the `save` action actually only
11931193
exists in the parent. The same is true for `data-model`, though there is
11941194
some special handling for this case (see next point).
11951195

@@ -1201,23 +1201,23 @@ Suppose a child component has a:
12011201
<textarea data-model="markdown_value" data-action="live#update">
12021202
```
12031203

1204-
When the user changes this field, this will *only* update the `markdown_value`
1205-
field in the *child* component... because (yup, we're saying it again):
1204+
When the user changes this field, this will _only_ update the `markdown_value`
1205+
field in the _child_ component... because (yup, we're saying it again):
12061206
each component is its own, isolated universe.
12071207

12081208
However, sometimes this isn't what you want! Sometimes, in addition
1209-
to updating the child component's model, you *also* want to update a
1210-
model on the *parent* component.
1209+
to updating the child component's model, you _also_ want to update a
1210+
model on the _parent_ component.
12111211

12121212
To help with this, whenever a model updates, a `live:update-model`
12131213
is dispatched. All components automatically listen to this event. This
12141214
means that, when the `markdown_value` model is updated in the child
1215-
component, *if* the parent component *also* has a model called `markdown_value`
1216-
it will *also* be updated. This is done as a "deferred" update
1215+
component, _if_ the parent component _also_ has a model called `markdown_value`
1216+
it will _also_ be updated. This is done as a "deferred" update
12171217
(i.e. [updateDefer()](#deferring-a-re-render-until-later)).
12181218

12191219
If the model name in your child component (e.g. `markdown_value`) is
1220-
*different* than the model name in your parent component (e.g. `post.content`),
1220+
_different_ than the model name in your parent component (e.g. `post.content`),
12211221
you can make sure both are set by leveraging both the `data-model`
12221222
and `name` attributes:
12231223

@@ -1231,7 +1231,7 @@ and `name` attributes:
12311231

12321232
In this situation, the `markdown_value` model will be updated on the child
12331233
component (because `data-model` takes precedence over `name`). But if
1234-
any parent components have a `markdown_value` model *or* a `post.content`
1234+
any parent components have a `markdown_value` model _or_ a `post.content`
12351235
model (normalized from `post[content`]`), their model will also be updated.
12361236

12371237
### Full Embedded Component Example
@@ -1331,7 +1331,7 @@ In the `EditPostComponent` template, you render the `MarkdownTextareaComponent`:
13311331
```
13321332

13331333
Notice that `MarkdownTextareaComponent` allows a dynamic `name` attribute to
1334-
be passed in. This makes that component re-usable in any form. But it
1334+
be passed in. This makes that component re-usable in any form. But it
13351335
also makes sure that when the `textarea` changes, both the `value` model
1336-
in `MarkdownTextareaComponent` *and* the `post.content` model in
1336+
in `MarkdownTextareaComponent` _and_ the `post.content` model in
13371337
`EditPostcomponent` will be updated.

src/TwigComponent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class FeaturedProductsComponent
329329
It's totally possible to embed one component into another. When you do
330330
this, there's nothing special to know: both components render independently.
331331
If you're using [Live Components](https://github.com/symfony/ux-live-component),
332-
then there *are* some guidelines related to how the re-rendering of parent
332+
then there _are_ some guidelines related to how the re-rendering of parent
333333
and child components works. Read [Live Embedded Components](https://github.com/symfony/ux-live-component#embedded-components).
334334

335335
## Contributing

0 commit comments

Comments
 (0)