Feat: revert FC changes (like the old style).

This commit reverts to the old style of props + FC. The old style is desirable
because people comfortable with react can automatically be comfortable with
dioxus. It's also nice in that the same props can be used to drive two different
components - something the trait version couldn't do. Now, our trait bound forces
implementations to have the #[derive(Props)] flag. This will need to implement the
Properties trait as well as PartialEq (using ptr::equal for closure fields).
This commit is contained in:
Jonathan Kelley committed 2021-03-09 00:58:20 -05:00
1 parent 55a5541dba
commit 7158bc3575
15 files changed
+1339 -137

No files matched your search

+6 -2
View File
@@ -5,7 +5,7 @@ use std::{borrow::BorrowMut, ops::Deref};
use crate::{
context::NodeCtx,
events::VirtualEvent,
innerlude::VComponent,
innerlude::{VComponent, FC},
nodes::{Attribute, Listener, NodeKey, VNode},
prelude::VElement,
};
@@ -526,7 +526,11 @@ pub fn attr<'a>(name: &'static str, value: &'a str) -> Attribute<'a> {
// _f: crate::innerlude::FC<T>,
// _props: T
pub fn virtual_child<'a, T: crate::scope::FC>(ctx: &'a NodeCtx<'a>, p: T) -> VNode<'a> {
pub fn virtual_child<'a, 'b, T: crate::innerlude::Properties>(
ctx: &'b NodeCtx<'a>,
p: T,
f: FC<T>,
) -> VNode<'a> {
todo!()
// VNode::Component()
}