make all core tests compile
This commit is contained in:
1 parent
a9d09d858b
commit
fd0a53ab63
21 files changed
+123
-148
No files matched your search
@@ -76,7 +76,7 @@ impl<const A: bool> FragmentBuilder<A> {
|
||||
/// children: Element
|
||||
/// }
|
||||
///
|
||||
/// fn CustomCard(cx: Scope<CardProps>) -> Element {
|
||||
/// fn CustomCard(cx: CardProps) -> Element {
|
||||
/// cx.render(rsx!{
|
||||
/// div {
|
||||
/// h1 {"Title card"}
|
||||
|
||||
@@ -50,7 +50,7 @@ pub(crate) mod innerlude {
|
||||
/// ## Rust-Style
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn example(cx: Scope<Props>) -> Element {
|
||||
/// fn example(cx: Props) -> Element {
|
||||
/// // ...
|
||||
/// }
|
||||
///
|
||||
@@ -60,7 +60,7 @@ pub(crate) mod innerlude {
|
||||
/// ```
|
||||
/// ## React-Style
|
||||
/// ```rust, ignore
|
||||
/// fn Example(cx: Scope<Props>) -> Element {
|
||||
/// fn Example(cx: Props) -> Element {
|
||||
/// // ...
|
||||
/// }
|
||||
///
|
||||
|
||||
@@ -461,7 +461,7 @@ impl VComponent {
|
||||
/// async fn(Scope<'_>) -> Element;
|
||||
///
|
||||
/// // With explicit props
|
||||
/// fn(Scope<Props>) -> Element;
|
||||
/// fn(Props) -> Element;
|
||||
/// async fn(Scope<Props<'_>>) -> Element;
|
||||
/// ```
|
||||
pub fn new<F: HasProps<P> + 'static, P: 'static>(
|
||||
@@ -649,7 +649,7 @@ impl AttributeValue {
|
||||
}
|
||||
|
||||
/// Create a new [`AttributeValue`] with a value that implements [`AnyValue`]
|
||||
pub fn any_value<T: AnyValue>(&self, value: T) -> AttributeValue {
|
||||
pub fn any_value<T: AnyValue>(value: T) -> AttributeValue {
|
||||
AttributeValue::Any(Box::new(value))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ impl Runtime {
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// fn Component(cx: Scope<ComponentProps>) -> Element {
|
||||
/// fn Component(cx: ComponentProps) -> Element {
|
||||
/// cx.use_hook(|| RuntimeGuard::new(cx.runtime.clone()));
|
||||
///
|
||||
/// render! { div {} }
|
||||
|
||||
@@ -383,4 +383,9 @@ impl ScopeId {
|
||||
pub fn schedule_update(&self) -> Arc<dyn Fn() + Send + Sync + 'static> {
|
||||
with_scope(*self, |cx| cx.schedule_update()).expect("to be in a dioxus runtime")
|
||||
}
|
||||
|
||||
/// Get the height of the current scope
|
||||
pub fn height(self) -> u32 {
|
||||
with_scope(self, |cx| cx.height()).expect("to be in a dioxus runtime")
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ use std::{any::Any, cell::Cell, collections::BTreeSet, future::Future, rc::Rc};
|
||||
/// title: String
|
||||
/// }
|
||||
///
|
||||
/// fn App(cx: Scope<AppProps>) -> Element {
|
||||
/// fn App(cx: AppProps) -> Element {
|
||||
/// cx.render(rsx!(
|
||||
/// div {"hello, {cx.title}"}
|
||||
/// ))
|
||||
@@ -55,7 +55,7 @@ use std::{any::Any, cell::Cell, collections::BTreeSet, future::Future, rc::Rc};
|
||||
/// static ROUTES: &str = "";
|
||||
///
|
||||
/// #[component]
|
||||
/// fn App(cx: Scope<AppProps>) -> Element {
|
||||
/// fn App(cx: AppProps) -> Element {
|
||||
/// cx.render(rsx!(
|
||||
/// NavBar { routes: ROUTES }
|
||||
/// Title { "{cx.title}" }
|
||||
@@ -247,7 +247,7 @@ impl VirtualDom {
|
||||
/// name: &'static str
|
||||
/// }
|
||||
///
|
||||
/// fn Example(cx: Scope<SomeProps>) -> Element {
|
||||
/// fn Example(cx: SomeProps) -> Element {
|
||||
/// cx.render(rsx!{ div{ "hello {cx.name}" } })
|
||||
/// }
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user