Remix.run Logo
▲ dnautics 4 hours ago

> you can accomplish this

That's not HTML though, you have to learn a whole new dsl that must conform to rust parser rules. So, not the same thing at all.

▲josephg 4 hours ago | parent | next [-]

You can do actual html. This is Leptos, a Solidjs like rust library:

    #[component]
    fn App() -> impl IntoView {
        let (count, set_count) = signal(0);
        view! {
            <button
                on:click=move |_| set_count.set(3) >
                "Click me”</button>
            <p>{move || count.get() * 2}</p>
        }
    }
▲slopinthebag 3 hours ago | parent | prev [-]

i prefer it, but you can also get html if you want

eg

   html! {
       <div onclick=|_ev: web_sys::MouseEvent| {}>
          You can type text right into the elements
          { component }
          { text_var }
       </div>
    };