feat: add an unhygenic render macro (#556)
* feat: add an unhygenic render macro * chore: use render instead of rsx!(cx,
This commit is contained in:
1 parent
0c48cb3601
commit
28fba42e7e
28 files changed
+158
-163
No files matched your search
@@ -72,6 +72,26 @@ pub fn rsx(s: TokenStream) -> TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
/// The render! macro makes it easy for developers to write jsx-style markup in their components.
|
||||
///
|
||||
/// The render macro automatically renders rsx - making it unhygenic.
|
||||
///
|
||||
/// ## Complete Reference Guide:
|
||||
/// ```ignore
|
||||
#[doc = include_str!("../../../examples/rsx_usage.rs")]
|
||||
/// ```
|
||||
#[proc_macro]
|
||||
pub fn render(s: TokenStream) -> TokenStream {
|
||||
match syn::parse::<rsx::CallBody>(s) {
|
||||
Err(err) => err.to_compile_error().into(),
|
||||
Ok(body) => quote::quote! {
|
||||
cx.render(#body)
|
||||
}
|
||||
.into_token_stream()
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Derive props for a component within the component definition.
|
||||
///
|
||||
/// This macro provides a simple transformation from `Scope<{}>` to `Scope<P>`,
|
||||
|
||||
@@ -7,7 +7,7 @@ To build new apps with Dioxus or to extend the ecosystem with new hooks or compo
|
||||
|
||||
```rust, ignore
|
||||
fn app(cx: Scope) -> Element {
|
||||
rsx!(cx, div { "hello world" })
|
||||
render!(div { "hello world" })
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -32,7 +32,7 @@ impl BubbleState {
|
||||
/// # Example
|
||||
/// ```rust, ignore
|
||||
/// fn App(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div {
|
||||
/// render!(div {
|
||||
/// onclick: move |_| println!("Clicked!")
|
||||
/// })
|
||||
/// }
|
||||
|
||||
@@ -528,7 +528,7 @@ impl ScopeState {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn App(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div { "Subtree {id}"})
|
||||
/// render!(div { "Subtree {id}"})
|
||||
/// };
|
||||
/// ```
|
||||
///
|
||||
@@ -659,12 +659,12 @@ impl ScopeState {
|
||||
///
|
||||
/// static App: Component = |cx| {
|
||||
/// cx.use_hook(|| cx.provide_context(SharedState("world")));
|
||||
/// rsx!(cx, Child {})
|
||||
/// render!(Child {})
|
||||
/// }
|
||||
///
|
||||
/// static Child: Component = |cx| {
|
||||
/// let state = cx.consume_state::<SharedState>();
|
||||
/// rsx!(cx, div { "hello {state.0}" })
|
||||
/// render!(div { "hello {state.0}" })
|
||||
/// }
|
||||
/// ```
|
||||
pub fn provide_context<T: 'static + Clone>(&self, value: T) -> T {
|
||||
@@ -685,12 +685,12 @@ impl ScopeState {
|
||||
///
|
||||
/// static App: Component = |cx| {
|
||||
/// cx.use_hook(|| cx.provide_root_context(SharedState("world")));
|
||||
/// rsx!(cx, Child {})
|
||||
/// render!(Child {})
|
||||
/// }
|
||||
///
|
||||
/// static Child: Component = |cx| {
|
||||
/// let state = cx.consume_state::<SharedState>();
|
||||
/// rsx!(cx, div { "hello {state.0}" })
|
||||
/// render!(div { "hello {state.0}" })
|
||||
/// }
|
||||
/// ```
|
||||
pub fn provide_root_context<T: 'static + Clone>(&self, value: T) -> T {
|
||||
|
||||
@@ -597,7 +597,7 @@ impl VirtualDom {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn Base(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div {})
|
||||
/// render!(div {})
|
||||
/// }
|
||||
///
|
||||
/// let dom = VirtualDom::new(Base);
|
||||
@@ -617,7 +617,7 @@ impl VirtualDom {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn Base(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div {})
|
||||
/// render!(div {})
|
||||
/// }
|
||||
///
|
||||
/// let dom = VirtualDom::new(Base);
|
||||
@@ -639,7 +639,7 @@ impl VirtualDom {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn Base(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div {})
|
||||
/// render!(div {})
|
||||
/// }
|
||||
///
|
||||
/// let dom = VirtualDom::new(Base);
|
||||
@@ -662,7 +662,7 @@ impl VirtualDom {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn Base(cx: Scope) -> Element {
|
||||
/// rsx!(cx, div {})
|
||||
/// render!(div {})
|
||||
/// }
|
||||
///
|
||||
/// let dom = VirtualDom::new(Base);
|
||||
|
||||
@@ -23,7 +23,7 @@ fn create_rows(c: &mut Criterion) {
|
||||
static App: Component = |cx| {
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
|
||||
rsx!(cx, table {
|
||||
render!(table {
|
||||
tbody {
|
||||
(0..10_000_usize).map(|f| {
|
||||
let label = Label::new(&mut rng);
|
||||
|
||||
@@ -26,7 +26,7 @@ pub mod prelude {
|
||||
pub use dioxus_core::prelude::*;
|
||||
|
||||
#[cfg(feature = "macro")]
|
||||
pub use dioxus_core_macro::{format_args_f, inline_props, rsx, Props};
|
||||
pub use dioxus_core_macro::{format_args_f, inline_props, render, rsx, Props};
|
||||
|
||||
#[cfg(feature = "html")]
|
||||
pub use dioxus_html as dioxus_elements;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn new_dom() -> VirtualDom {
|
||||
VirtualDom::new(|cx| rsx!(cx, "hi"))
|
||||
VirtualDom::new(|cx| render!("hi"))
|
||||
}
|
||||
|
||||
use dioxus_core::DomEdit::*;
|
||||
|
||||
@@ -28,7 +28,7 @@ fn test_early_abort() {
|
||||
return None;
|
||||
}
|
||||
|
||||
rsx!(cx, div { "Hello, world!" })
|
||||
render!(div { "Hello, world!" })
|
||||
};
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
|
||||
@@ -54,7 +54,7 @@ fn test_memory_leak() {
|
||||
}
|
||||
|
||||
fn BorrowedChild<'a>(cx: Scope<'a, BorrowedProps<'a>>) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
"goodbye {cx.props.na}"
|
||||
Child {}
|
||||
Child {}
|
||||
@@ -62,7 +62,7 @@ fn test_memory_leak() {
|
||||
}
|
||||
|
||||
fn Child(cx: Scope) -> Element {
|
||||
rsx!(cx, div { "goodbye world" })
|
||||
render!(div { "goodbye world" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -101,7 +101,7 @@ fn memo_works_properly() {
|
||||
}
|
||||
|
||||
fn Child(cx: Scope<ChildProps>) -> Element {
|
||||
rsx!(cx, div { "goodbye world" })
|
||||
render!(div { "goodbye world" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -133,7 +133,7 @@ fn free_works_on_root_props() {
|
||||
}
|
||||
|
||||
fn Child(cx: Scope<ChildProps>) -> Element {
|
||||
rsx!(cx, "child {cx.props.a}")
|
||||
render!("child {cx.props.a}")
|
||||
}
|
||||
|
||||
struct Custom {
|
||||
@@ -165,7 +165,7 @@ fn free_works_on_borrowed() {
|
||||
|
||||
fn Child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element {
|
||||
dbg!("rendering child");
|
||||
rsx!(cx, "child {cx.props.a}, {cx.props.b}")
|
||||
render!("child {cx.props.a}, {cx.props.b}")
|
||||
}
|
||||
|
||||
impl Drop for ChildProps<'_> {
|
||||
@@ -193,7 +193,7 @@ fn free_works_on_root_hooks() {
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let name = cx.use_hook(|| Droppable(String::from("asd")));
|
||||
rsx!(cx, div { "{name.0}" })
|
||||
render!(div { "{name.0}" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -208,9 +208,9 @@ fn old_props_arent_stale() {
|
||||
*cnt += 1;
|
||||
|
||||
if *cnt == 1 {
|
||||
rsx!(cx, div { Child { a: "abcdef".to_string() } })
|
||||
render!(div { Child { a: "abcdef".to_string() } })
|
||||
} else {
|
||||
rsx!(cx, div { Child { a: "abcdef".to_string() } })
|
||||
render!(div { Child { a: "abcdef".to_string() } })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ fn old_props_arent_stale() {
|
||||
}
|
||||
fn Child(cx: Scope<ChildProps>) -> Element {
|
||||
dbg!("rendering child", &cx.props.a);
|
||||
rsx!(cx, div { "child {cx.props.a}" })
|
||||
render!(div { "child {cx.props.a}" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -250,7 +250,7 @@ fn old_props_arent_stale() {
|
||||
#[test]
|
||||
fn basic() {
|
||||
fn app(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
Child { a: "abcdef".to_string() }
|
||||
})
|
||||
}
|
||||
@@ -262,7 +262,7 @@ fn basic() {
|
||||
|
||||
fn Child(cx: Scope<ChildProps>) -> Element {
|
||||
dbg!("rendering child", &cx.props.a);
|
||||
rsx!(cx, div { "child {cx.props.a}" })
|
||||
render!(div { "child {cx.props.a}" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -290,7 +290,7 @@ fn leak_thru_children() {
|
||||
|
||||
#[inline_props]
|
||||
fn Child(cx: Scope, name: String) -> Element {
|
||||
rsx!(cx, div { "child {name}" })
|
||||
render!(div { "child {name}" })
|
||||
}
|
||||
|
||||
let mut dom = new_dom(app, ());
|
||||
@@ -315,8 +315,7 @@ fn test_pass_thru() {
|
||||
}
|
||||
|
||||
fn NavMenu(cx: Scope) -> Element {
|
||||
rsx!(cx,
|
||||
NavBrand {}
|
||||
render!( NavBrand {}
|
||||
div {
|
||||
NavStart {}
|
||||
NavEnd {}
|
||||
@@ -325,15 +324,15 @@ fn test_pass_thru() {
|
||||
}
|
||||
|
||||
fn NavBrand(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
fn NavStart(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
fn NavEnd(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn new_dom() -> VirtualDom {
|
||||
VirtualDom::new(|cx| rsx!(cx, "hi"))
|
||||
VirtualDom::new(|cx| render!("hi"))
|
||||
}
|
||||
|
||||
use dioxus_core::DomEdit::*;
|
||||
|
||||
@@ -15,7 +15,7 @@ use dioxus_core::DomEdit::*;
|
||||
|
||||
#[test]
|
||||
fn app_runs() {
|
||||
static App: Component = |cx| rsx!(cx, div{"hello"} );
|
||||
static App: Component = |cx| render!(div{"hello"} );
|
||||
|
||||
let mut vdom = VirtualDom::new(App);
|
||||
let edits = vdom.rebuild();
|
||||
|
||||
@@ -67,7 +67,7 @@ macro_rules! test_state{
|
||||
fn state_reduce_initally_called_minimally() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
div{
|
||||
div{
|
||||
p{}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct Empty {}
|
||||
fn remove_node() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let vdom = VirtualDom::new(Base);
|
||||
@@ -87,7 +87,7 @@ fn remove_node() {
|
||||
fn add_node() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let vdom = VirtualDom::new(Base);
|
||||
|
||||
@@ -16,7 +16,7 @@ fn initial_build_simple() {
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let vdom = VirtualDom::new(Base);
|
||||
@@ -47,7 +47,7 @@ fn initial_build_simple() {
|
||||
fn initial_build_with_children() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let vdom = VirtualDom::new(Base);
|
||||
|
||||
@@ -15,7 +15,7 @@ struct Empty {}
|
||||
fn traverse() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
let vdom = VirtualDom::new(Base);
|
||||
let mutations = vdom.create_vnodes(rsx! {
|
||||
@@ -108,7 +108,7 @@ fn traverse() {
|
||||
fn persist_removes() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
let vdom = VirtualDom::new(Base);
|
||||
let (build, update) = vdom.diff_lazynodes(
|
||||
@@ -196,7 +196,7 @@ fn persist_removes() {
|
||||
fn persist_instertions_before() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
let vdom = VirtualDom::new(Base);
|
||||
let (build, update) = vdom.diff_lazynodes(
|
||||
@@ -262,7 +262,7 @@ fn persist_instertions_before() {
|
||||
fn persist_instertions_after() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
let vdom = VirtualDom::new(Base);
|
||||
let (build, update) = vdom.diff_lazynodes(
|
||||
|
||||
@@ -163,7 +163,7 @@ struct StateTester {
|
||||
fn state_initial() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
p{}
|
||||
h1{}
|
||||
})
|
||||
@@ -240,7 +240,7 @@ fn state_initial() {
|
||||
fn state_reduce_parent_called_minimally_on_update() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
width: "100%",
|
||||
div{
|
||||
div{
|
||||
@@ -307,7 +307,7 @@ fn state_reduce_parent_called_minimally_on_update() {
|
||||
fn state_reduce_child_called_minimally_on_update() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
div{
|
||||
div{
|
||||
p{
|
||||
@@ -435,7 +435,7 @@ impl NodeDepState<()> for CDepCallCounter {
|
||||
fn dependancies_order_independant() {
|
||||
#[allow(non_snake_case)]
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {
|
||||
render!(div {
|
||||
width: "100%",
|
||||
p{
|
||||
"hello"
|
||||
|
||||
+9
-32
@@ -30,25 +30,15 @@ use proc_macro2::TokenStream as TokenStream2;
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
Ident, Result, Token,
|
||||
Result, Token,
|
||||
};
|
||||
|
||||
pub struct CallBody {
|
||||
pub custom_context: Option<Ident>,
|
||||
pub roots: Vec<BodyNode>,
|
||||
}
|
||||
|
||||
impl Parse for CallBody {
|
||||
fn parse(input: ParseStream) -> Result<Self> {
|
||||
let custom_context = if input.peek(Ident) && input.peek2(Token![,]) {
|
||||
let name = input.parse::<Ident>()?;
|
||||
input.parse::<Token![,]>()?;
|
||||
|
||||
Some(name)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let mut roots = Vec::new();
|
||||
|
||||
while !input.is_empty() {
|
||||
@@ -61,10 +51,7 @@ impl Parse for CallBody {
|
||||
roots.push(node);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
custom_context,
|
||||
roots,
|
||||
})
|
||||
Ok(Self { roots })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,22 +66,12 @@ impl ToTokens for CallBody {
|
||||
quote! { __cx.fragment_root([ #(#childs),* ]) }
|
||||
};
|
||||
|
||||
match &self.custom_context {
|
||||
// The `in cx` pattern allows directly rendering
|
||||
Some(ident) => out_tokens.append_all(quote! {
|
||||
#ident.render(LazyNodes::new(move |__cx: NodeFactory| -> VNode {
|
||||
use dioxus_elements::{GlobalAttributes, SvgAttributes};
|
||||
#inner
|
||||
}))
|
||||
}),
|
||||
|
||||
// Otherwise we just build the LazyNode wrapper
|
||||
None => out_tokens.append_all(quote! {
|
||||
LazyNodes::new(move |__cx: NodeFactory| -> VNode {
|
||||
use dioxus_elements::{GlobalAttributes, SvgAttributes};
|
||||
#inner
|
||||
})
|
||||
}),
|
||||
};
|
||||
// Otherwise we just build the LazyNode wrapper
|
||||
out_tokens.append_all(quote! {
|
||||
LazyNodes::new(move |__cx: NodeFactory| -> VNode {
|
||||
use dioxus_elements::{GlobalAttributes, SvgAttributes};
|
||||
#inner
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -30,10 +30,7 @@ impl CapturedContextBuilder {
|
||||
}
|
||||
|
||||
pub fn from_call_body(body: CallBody) -> Result<Self> {
|
||||
let mut new = Self {
|
||||
custom_context: body.custom_context,
|
||||
..Default::default()
|
||||
};
|
||||
let mut new = Self::default();
|
||||
for node in body.roots {
|
||||
new.extend(Self::find_captured(node)?);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use dioxus::prelude::*;
|
||||
#[allow(non_snake_case)]
|
||||
fn render_basic() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -44,7 +44,7 @@ fn render_basic() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_nested() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -96,7 +96,7 @@ fn render_nested() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_custom_attribute() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -144,11 +144,11 @@ fn render_custom_attribute() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_component() {
|
||||
fn Comp(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -200,7 +200,7 @@ fn render_component() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_iterator() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -254,7 +254,7 @@ fn render_iterator() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_captured_variable() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
@@ -309,7 +309,7 @@ fn render_captured_variable() {
|
||||
#[allow(non_snake_case)]
|
||||
fn render_listener() {
|
||||
fn Base(cx: Scope) -> Element {
|
||||
rsx!(cx, div {})
|
||||
render!(div {})
|
||||
}
|
||||
|
||||
let dom = VirtualDom::new(Base);
|
||||
|
||||
@@ -89,7 +89,7 @@ mod util;
|
||||
/// }
|
||||
///
|
||||
/// static App: Component = |cx| {
|
||||
/// rsx!(cx, div {"hello world"})
|
||||
/// render!(div {"hello world"})
|
||||
/// }
|
||||
/// ```
|
||||
pub fn launch(root_component: Component) {
|
||||
@@ -140,7 +140,7 @@ pub fn launch_cfg(root: Component, config: Config) {
|
||||
/// }
|
||||
///
|
||||
/// static App: Component<RootProps> = |cx| {
|
||||
/// rsx!(cx, div {"hello {cx.props.name}"})
|
||||
/// render!(div {"hello {cx.props.name}"})
|
||||
/// }
|
||||
/// ```
|
||||
pub fn launch_with_props<T>(root_component: Component<T>, root_properties: T, config: Config)
|
||||
|
||||
Reference in new issue
Block a user