depreciate the render macro
This commit is contained in:
1 parent
90d0164b9e
commit
e65c5f0eb3
148 files changed
+459
-458
No files matched your search
@@ -75,7 +75,7 @@ where
|
||||
///
|
||||
/// ```rust
|
||||
/// fn app() -> Element {
|
||||
/// render! {
|
||||
/// rsx! {
|
||||
/// div {}
|
||||
/// }
|
||||
/// }
|
||||
@@ -90,7 +90,7 @@ where
|
||||
/// }
|
||||
///
|
||||
/// fn app(props: MyProps) -> Element {
|
||||
/// render! {
|
||||
/// rsx! {
|
||||
/// div {
|
||||
/// "{props.data}"
|
||||
/// }
|
||||
@@ -103,7 +103,7 @@ where
|
||||
/// ```rust
|
||||
/// #[component]
|
||||
/// fn app(data: String) -> Element {
|
||||
/// render! {
|
||||
/// rsx! {
|
||||
/// div {
|
||||
/// "{data}"
|
||||
/// }
|
||||
|
||||
@@ -140,7 +140,7 @@ impl Runtime {
|
||||
/// }
|
||||
///
|
||||
/// fn app() -> Element {
|
||||
/// render!{ Component { runtime: Runtime::current().unwrap() } }
|
||||
/// rsx!{ Component { runtime: Runtime::current().unwrap() } }
|
||||
/// }
|
||||
///
|
||||
/// // In a dynamic library
|
||||
@@ -158,7 +158,7 @@ impl Runtime {
|
||||
/// fn Component(cx: ComponentProps) -> Element {
|
||||
/// cx.use_hook(|| RuntimeGuard::new(cx.runtime.clone()));
|
||||
///
|
||||
/// render! { div {} }
|
||||
/// rsx! { div {} }
|
||||
/// }
|
||||
/// ```
|
||||
pub struct RuntimeGuard(());
|
||||
|
||||
@@ -176,12 +176,12 @@ impl ScopeContext {
|
||||
///
|
||||
/// static app: Component = |cx| {
|
||||
/// cx.use_hook(|| cx.provide_context(SharedState("world")));
|
||||
/// render!(Child {})
|
||||
/// rsx!(Child {})
|
||||
/// }
|
||||
///
|
||||
/// static Child: Component = |cx| {
|
||||
/// let state = cx.consume_state::<SharedState>();
|
||||
/// render!(div { "hello {state.0}" })
|
||||
/// rsx!(div { "hello {state.0}" })
|
||||
/// }
|
||||
/// ```
|
||||
pub fn provide_context<T: 'static + Clone>(&self, value: T) -> T {
|
||||
|
||||
Reference in new issue
Block a user