Closed MhhhxX closed 1 month ago
Using the async hook inside a struct component produces the following error when calling the run function:
error[E0061]: this method takes 1 argument but 0 arguments were supplied --> src/app/components.rs:38:15 | 38 | p.run(); | ^^^-- argument #1 of type `&mut HookContext` is missing | note: method defined here --> /.cargo/registry/src/index.crates.io-6f17d22bba15001f/yew-0.21.0/src/functional/hooks/mod.rs:35:8 | 35 | fn run(self, ctx: &mut HookContext) -> Self::Output; | ^^^ help: provide the argument | 38 | p.run(/* &mut HookContext */); | ~~~~~~~~~~~~~~~~~~~~~~~~
How can I provide the hook context here?
Hooks in yew can only support function components, you cannot use them in struct component.
Using the async hook inside a struct component produces the following error when calling the run function:
How can I provide the hook context here?