You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LiveComponent/doc/index.rst
+5-18Lines changed: 5 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,36 +183,23 @@ let's keep going because… things get cooler.
183
183
184
184
Hooks: Handle Component Behavior
185
185
--------------------------------
186
-
Most of the time, you'll just pass data to your components and
187
-
let it handle the rest. However, if you need to do something
188
-
more complex during certain stages of a component's lifecycle, you
189
-
can take advantage of lifecycle hooks.
186
+
Most of the time, you'll just pass data to your components and let it handle the rest. However, if you need to do something more complex during certain stages of a component's lifecycle, you can take advantage of lifecycle hooks.
190
187
191
188
``PostHydrate`` Hook
192
189
~~~~~~~~~~~~~~~~~~~~
193
-
The ``#[PostHydrate]`` hook is called immediately after the component's state
194
-
is loaded from the client. This is useful if you need to process or adjust
195
-
the data once it’s been hydrated.
190
+
The ``#[PostHydrate]`` hook is called immediately after the component's state is loaded from the client. This is useful if you need to process or adjust the data once it’s been hydrated.
196
191
197
192
``PreDehydrate`` Hook
198
193
~~~~~~~~~~~~~~~~~~~~~
199
-
The ``#[PreDehydrate]`` hook is triggered just before your component’s state
200
-
is sent back to the client. You can use this to modify or clean up the data
201
-
before it’s serialized and returned to the client.
194
+
The ``#[PreDehydrate]`` hook is triggered just before your component’s state is sent back to the client. You can use this to modify or clean up the data before it’s serialized and returned to the client.
202
195
203
196
``PreReRender`` Hook
204
197
~~~~~~~~~~~~~~~~~~~~
205
-
The ``#[PreReRender]`` hook is called before your component is re-rendered
206
-
during an HTTP request. It does not run during the initial render but is
207
-
helpful when you need to adjust the state before sending it back to
208
-
the client for re-rendering.
198
+
The ``#[PreReRender]`` hook is called before your component is re-rendered during an HTTP request. It does not run during the initial render but is helpful when you need to adjust the state before sending it back to the client for re-rendering.
209
199
210
200
Hook Priority
211
201
~~~~~~~~~~~~~
212
-
You can control the order in which hooks are executed by using the ``priority``
213
-
argument. If multiple hooks of the same type are registered in a component, those
214
-
with a higher priority value will run first. This allows you to manage the order
215
-
in which your actions are performed within the same lifecycle stage::
202
+
You can control the order in which hooks are executed by using the ``priority`` argument. If multiple hooks of the same type are registered in a component, those with a higher priority value will run first. This allows you to manage the order in which your actions are performed within the same lifecycle stage::
0 commit comments