Skip to content

Commit b58a874

Browse files
fix the docs of use_prepared_state (#3881)
1 parent 4f3b85e commit b58a874

File tree

1 file changed

+3
-3
lines changed
  • packages/yew/src/functional/hooks/use_prepared_state

1 file changed

+3
-3
lines changed

packages/yew/src/functional/hooks/use_prepared_state/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ pub use feat_ssr::*;
2121
/// The component sees the same value on the server side and client side if the component is
2222
/// hydrated.
2323
///
24-
/// It accepts a closure as the first argument and a dependency type as the second argument.
24+
/// It accepts a closure as the second argument and its dependency value as the first argument.
2525
/// It returns `SuspensionResult<Option<Rc<T>>>`.
2626
///
2727
/// During hydration, it will only return `Ok(Some(Rc<T>))` if the component is hydrated from a
2828
/// server-side rendering artifact and its dependency value matches.
2929
///
30-
/// `let state = use_prepared_state!(|deps| -> ReturnType { ... }, deps)?;`
30+
/// `let state = use_prepared_state!(deps, |deps| -> ReturnType { ... })?;`
3131
///
3232
/// It has the following signature:
3333
///
@@ -49,7 +49,7 @@ pub use feat_ssr::*;
4949
///
5050
/// The first argument can also be an async closure
5151
///
52-
/// `let state = use_prepared_state!(async |deps| -> ReturnType { ... }, deps)?;`
52+
/// `let state = use_prepared_state!(deps, async |deps| -> ReturnType { ... })?;`
5353
///
5454
/// When accepting an async closure, it has the following signature:
5555
///

0 commit comments

Comments
 (0)