depreciate the render macro

This commit is contained in:
Evan Almloff committed 2024-01-16 13:18:46 -06:00
1 parent 90d0164b9e
commit e65c5f0eb3
148 files changed
+459 -458

No files matched your search

+3 -3
View File
@@ -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}"
/// }
+2 -2
View File
@@ -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(());
+2 -2
View File
@@ -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 {