Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component<_> is not implemented for fn(IconProps<_>) -> Result<VNode, RenderError> {Icon::<_>} #57

Closed
markcda opened this issue Nov 4, 2024 · 7 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@markcda
Copy link

markcda commented Nov 4, 2024

00:00:49 [cargo] error[E0277]: `Component<_>` is not implemented for `fn(IconProps<_>) -> Result<VNode, RenderError> {Icon::<_>}`
   --> /home/titoffklim/project/src/components/accordion.rs:94:9
    |
87  | /   rsx! {
88  | |     div {
89  | |       class: "flex",
90  | |       button {
...   |
94  | |         Icon {
    | |         ^^^^ Component
...   |
99  | |     }
100 | |   }
    | |___- required by a bound introduced by this call
    |
    = note: consider using `--verbose` to print the full type name to the console
    = help: the trait `ComponentFunction<_, _>` is not implemented for fn item `fn(IconProps<_>) -> Result<VNode, RenderError> {Icon::<_>}`
    = note: Components are functions in the form `fn() -> Element`, `fn(props: Properties) -> Element`, or `#[component] fn(partial_eq1: u32, partial_eq2: u32) -> Element`.
    = note: You may have forgotten to add `#[component]` to your function to automatically implement the `ComponentFunction` trait.
note: required by a bound in `dioxus::prelude::fc_to_builder`
   --> /home/titoffklim/.cargo/git/checkouts/dioxus-1e619ce595d3799d/e0575b3/packages/core/src/properties.rs:110:36

This error shows up on 0.6.0-alpha.4 version, simple adding #[component] to pub fn Icon<T> isn't working

@marc2332
Copy link
Member

marc2332 commented Nov 4, 2024

This is because dioxus-free-icons's dioxus and your dioxus (alpha.4) don't match. Can you try with #55 ?

@marc2332 marc2332 self-assigned this Nov 4, 2024
@marc2332 marc2332 added the help wanted Extra attention is needed label Nov 4, 2024
@markcda
Copy link
Author

markcda commented Nov 4, 2024

Can you try with #55 ?

Yeah, already tried it

dioxus-free-icons = { git = "https://github.com/dioxus-community/dioxus-free-icons.git", branch = "feat/dioxus-0.6", features = ["hero-icons-solid"] }

@marc2332
Copy link
Member

marc2332 commented Nov 4, 2024

Can you try with #55 ?

Yeah, already tried it

dioxus-free-icons = { git = "https://github.com/dioxus-community/dioxus-free-icons.git", branch = "feat/dioxus-0.6", features = ["hero-icons-solid"] }

Try updating with cargo update, I updated it to alpha 4 just some minutes ago

@markcda
Copy link
Author

markcda commented Nov 4, 2024

Can you try with #55 ?

Yeah, already tried it

dioxus-free-icons = { git = "https://github.com/dioxus-community/dioxus-free-icons.git", branch = "feat/dioxus-0.6", features = ["hero-icons-solid"] }

Try updating with cargo update, I updated it to alpha 4 just some minutes ago

I've seen. This is the dioxus-free-icons/Cargo.toml that I using:

# monorepo only work when using virtual manifest
# see: https://github.com/rust-lang/cargo/issues/7467#issuecomment-867632379
[workspace]
resolver = "2"
members = [
    "packages/codegen",
    "packages/example",
    "packages/lib",
]

[workspace.dependencies]
dioxus = "0.6.0-alpha.4"

@markcda markcda changed the title Component<_> is not implemented for `fn(IconProps<_>) -> Result<VNode, RenderError> {Icon::<_>} Component<_> is not implemented for fn(IconProps<_>) -> Result<VNode, RenderError> {Icon::<_>} Nov 4, 2024
@marc2332
Copy link
Member

marc2332 commented Nov 4, 2024

But did you run cargo update?

@markcda
Copy link
Author

markcda commented Nov 4, 2024

But did you run cargo update?

Yes, of course.
I mean, I saw your update and sync in a minute. No changes at all. Tell me if you needed an example project to reproduce the error.

@markcda
Copy link
Author

markcda commented Nov 7, 2024

Well, I just created a project from scratch and everything compiled.

I'm so sorry for wasting your time. Thank for your patience!

@markcda markcda closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants