wip: staticify?
This commit is contained in:
1 parent
78d093a945
commit
5ad81885e4
21 files changed
+433
-346
No files matched your search
@@ -7,8 +7,6 @@
|
||||
|
||||
fn main() {}
|
||||
|
||||
|
||||
|
||||
use dioxus_core::prelude::*;
|
||||
|
||||
struct Props {
|
||||
@@ -73,9 +71,14 @@ impl PartialEq for ChildProps<'_> {
|
||||
|
||||
impl<'a> Properties for ChildProps<'a> {
|
||||
type Builder = ChildPropsBuilder<'a, ((), ())>;
|
||||
type StaticOutput = ChildProps<'static>;
|
||||
fn builder() -> <Self as Properties>::Builder {
|
||||
ChildProps::builder()
|
||||
}
|
||||
|
||||
unsafe fn into_static(self) -> Self::StaticOutput {
|
||||
unsafe { std::mem::transmute(self) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ChildItem(_ctx: Context, _props: &ChildProps) -> DomTree {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
use dioxus_core::component::fc_to_builder;
|
||||
use dioxus_core::prelude::*;
|
||||
|
||||
|
||||
|
||||
|
||||
static BLAH: FC<()> = |ctx, _props| {
|
||||
let g = "asd".to_string();
|
||||
ctx.render(rsx! {
|
||||
@@ -30,7 +27,12 @@ fn main() {}
|
||||
|
||||
impl Properties for ExampleProps {
|
||||
type Builder = ExamplePropsBuilder<((),)>;
|
||||
type StaticOutput = ExampleProps;
|
||||
fn builder() -> Self::Builder {
|
||||
ExampleProps::builder()
|
||||
}
|
||||
|
||||
unsafe fn into_static(self) -> Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
// #[macro_use]
|
||||
extern crate fstrings;
|
||||
|
||||
|
||||
|
||||
// use dioxus_core::ifmt;
|
||||
// use fstrings::format_args_f;
|
||||
|
||||
|
||||
fn main() {
|
||||
let bump = bumpalo::Bump::new();
|
||||
let _b = ≎
|
||||
|
||||
@@ -27,7 +27,12 @@ static Example: FC<SomeProps> = |ctx, _props| {
|
||||
// toodo: derive this
|
||||
impl Properties for SomeProps {
|
||||
type Builder = SomePropsBuilder<((),)>;
|
||||
type StaticOutput = SomeProps;
|
||||
fn builder() -> Self::Builder {
|
||||
SomeProps::builder()
|
||||
}
|
||||
|
||||
unsafe fn into_static(self) -> Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user