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

Re-exported components have the wrong name in tracing/warning #2743

Closed
1 of 3 tasks
ealmloff opened this issue Jul 30, 2024 · 0 comments · Fixed by #2744
Closed
1 of 3 tasks

Re-exported components have the wrong name in tracing/warning #2743

ealmloff opened this issue Jul 30, 2024 · 0 comments · Fixed by #2744
Assignees
Labels
bug Something isn't working core relating to the core implementation of the virtualdom rsx Related to rsx or the dioxus-rsx crate
Milestone

Comments

@ealmloff
Copy link
Member

Problem

When you re-export a component with a different name, we use that name instead of the original component name. That causes issues when we compare the type name and the component name when detecting components run from outside rsx

Steps To Reproduce

Run this code:

use dioxus::prelude::*;

fn main() {
    tracing_subscriber::fmt::init();

    launch(app);
}

fn app() -> Element {
    rsx! {
        InnerComponent {}
    }
}

use inner::MyComponent as InnerComponent;

mod inner {
    use dioxus::prelude::*;

    #[component]
    pub fn MyComponent() -> Element {
        rsx! {
            h1 { "Inner component" }
        }
    }
}

Expected behavior

The code should not log any warnings

Environment:

  • Dioxus version: main
  • Rust version: nightly
  • OS info: Macos
  • App platform: any

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom rsx Related to rsx or the dioxus-rsx crate labels Jul 30, 2024
@ealmloff ealmloff added this to the 0.6.0 milestone Jul 30, 2024
@ealmloff ealmloff self-assigned this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core relating to the core implementation of the virtualdom rsx Related to rsx or the dioxus-rsx crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant