Skip to content

Commit 05ae6d0

Browse files
bocharsky-bwweaverryan
authored andcommitted
Fix some code block styles & lost code block in docs
1 parent 36b6a1c commit 05ae6d0

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)