Skip to content

Commit b6f4d39

Browse files
committed
minor #1136 Fix some code block styles & lost code block in docs (bocharsky-bw)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- Fix some code block styles & lost code block in docs | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Tickets | no <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Features and deprecations must be submitted against branch main. --> <img width="878" alt="Screenshot 2023-09-22 at 17 06 21" src="https://github.com/symfony/ux/assets/3317635/1308a5e4-30b3-4532-b3f8-1f34129c8111"> Commits ------- 05ae6d0 Fix some code block styles & lost code block in docs
2 parents 36b6a1c + 05ae6d0 commit b6f4d39

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,17 +3100,12 @@ Add a Hook on LiveProp Update
31003100

31013101
If you want to run custom code after a specific LiveProp is updated,
31023102
you can do it by adding an ``onUpdated`` option set to a public method name
3103-
on the component:
3104-
3105-
.. code-block:: diff
3106-
3107-
// ...
3103+
on the component::
31083104

31093105
#[AsLiveComponent]
31103106
class ProductSearch
31113107
{
3112-
- #[LiveProp(writable: true)]
3113-
+ #[LiveProp(writable: true, onUpdated: 'onQueryUpdated')]
3108+
#[LiveProp(writable: true, onUpdated: 'onQueryUpdated')]
31143109
public string $query = '';
31153110

31163111
// ...
@@ -3121,17 +3116,14 @@ on the component:
31213116
// and its previous value is passed as an argument
31223117
}
31233118
}
3124-
}
31253119

3126-
As soon as the `query` LiveProp is updated, the ``onQueryUpdated()`` method
3120+
As soon as the ``query`` LiveProp is updated, the ``onQueryUpdated()`` method
31273121
will be called. The previous value is passed there as the first argument.
31283122

31293123
If you're allowing object properties to be writable, you can also listen to
3130-
the change of one specific key:
3124+
the change of one specific key::
31313125

3132-
.. code-block::
3133-
3134-
// ...
3126+
use App\Entity\Post;
31353127

31363128
#[AsLiveComponent]
31373129
class EditPost

0 commit comments

Comments
 (0)