wip: remove portals completely

This commit is contained in:
Jonathan Kelley committed 2021-12-14 21:46:19 -05:00
1 parent 8daf7a6ed8
commit 2fd56e7619
17 files changed
+259 -404

No files matched your search

+6 -6
View File
@@ -19,7 +19,7 @@ use DomEdit::*;
#[test]
fn app_runs() {
static App: Component<()> = |cx, props| rsx!(cx, div{"hello"} );
static App: Component<()> = |cx| rsx!(cx, div{"hello"} );
let mut vdom = VirtualDom::new(App);
let edits = vdom.rebuild();
@@ -27,7 +27,7 @@ fn app_runs() {
#[test]
fn fragments_work() {
static App: Component<()> = |cx, props| {
static App: Component<()> = |cx| {
cx.render(rsx!(
div{"hello"}
div{"goodbye"}
@@ -41,7 +41,7 @@ fn fragments_work() {
#[test]
fn lists_work() {
static App: Component<()> = |cx, props| {
static App: Component<()> = |cx| {
cx.render(rsx!(
h1 {"hello"}
{(0..6).map(|f| rsx!(span{ "{f}" }))}
@@ -54,7 +54,7 @@ fn lists_work() {
#[test]
fn conditional_rendering() {
static App: Component<()> = |cx, props| {
static App: Component<()> = |cx| {
cx.render(rsx!(
h1 {"hello"}
{true.then(|| rsx!(span{ "a" }))}
@@ -87,13 +87,13 @@ fn conditional_rendering() {
#[test]
fn child_components() {
static App: Component<()> = |cx, props| {
static App: Component<()> = |cx| {
cx.render(rsx!(
{true.then(|| rsx!(Child { }))}
{false.then(|| rsx!(Child { }))}
))
};
static Child: Component<()> = |cx, props| {
static Child: Component<()> = |cx| {
cx.render(rsx!(
h1 {"hello"}
h1 {"goodbye"}