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

Script ignores src attribute #2981

Open
DioxusGrow opened this issue Sep 19, 2024 · 0 comments
Open

Script ignores src attribute #2981

DioxusGrow opened this issue Sep 19, 2024 · 0 comments
Labels
bug Something isn't working html Related to the html crate

Comments

@DioxusGrow
Copy link

DioxusGrow commented Sep 19, 2024

The documentation specifies its use as

/// # Example
/// ```rust, no_run
/// # use dioxus::prelude::*;
/// fn LoadScript() -> Element {
///     rsx! {
///         // You can use the Script component to render a script tag into the head of the page
///         Script {
///             src: asset!("./assets/script.js"),
///         }
///     }
/// }
/// 

But since the use of direct links is removed from manganis, an error occurs when specifying a link directly.

fn App() -> Element {
    use_context_provider(|| Signal::new("en".to_string()));
    let mut lang: Signal<String> = use_context();

    
    info!("Lang is {}", lang());
    rsx! {
        head::Link { rel: "stylesheet", href: STYLE }
        // Note: For development use only. Remove before production.
        Script { src: "https://cdn.tailwindcss.com" }
        Router::<Route> {}
    }
}

image

Environment:

  • Dioxus version: 0.6.0-alpha.2 (b254692) from github 19/09/24
  • Rust version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  • OS info: Win11
  • App platform: web
@ealmloff ealmloff changed the title Script has some issue inside rsx Script ignores src attribute Sep 19, 2024
@ealmloff ealmloff added bug Something isn't working html Related to the html crate labels Sep 19, 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 html Related to the html crate
Projects
None yet
Development

No branches or pull requests

2 participants