feat: transition to cx, props

This commit is contained in:
Jonathan Kelley committed 2021-09-21 13:13:15 -04:00
1 parent f1cff845ce
commit bfdcb20437
14 files changed
+88 -50

No files matched your search

+8 -8
View File
@@ -18,7 +18,7 @@ fn new_dom<P: Properties + 'static>(app: FC<P>, props: P) -> VirtualDom {
#[test]
fn test_original_diff() {
static APP: FC<()> = |cx| {
static APP: FC<()> = |cx, props| {
cx.render(rsx! {
div {
div {
@@ -48,7 +48,7 @@ fn test_original_diff() {
#[test]
fn create() {
static APP: FC<()> = |cx| {
static APP: FC<()> = |cx, props| {
cx.render(rsx! {
div {
div {
@@ -99,7 +99,7 @@ fn create() {
#[test]
fn create_list() {
static APP: FC<()> = |cx| {
static APP: FC<()> = |cx, props| {
cx.render(rsx! {
{(0..3).map(|f| rsx!{ div {
"hello"
@@ -139,7 +139,7 @@ fn create_list() {
#[test]
fn create_simple() {
static APP: FC<()> = |cx| {
static APP: FC<()> = |cx, props| {
cx.render(rsx! {
div {}
div {}
@@ -165,7 +165,7 @@ fn create_simple() {
}
#[test]
fn create_components() {
static App: FC<()> = |cx| {
static App: FC<()> = |cx, props| {
cx.render(rsx! {
Child { "abc1" }
Child { "abc2" }
@@ -173,7 +173,7 @@ fn create_components() {
})
};
static Child: FC<()> = |cx| {
static Child: FC<()> = |cx, props| {
cx.render(rsx! {
h1 {}
div { {cx.children()} }
@@ -217,7 +217,7 @@ fn create_components() {
}
#[test]
fn anchors() {
static App: FC<()> = |cx| {
static App: FC<()> = |cx, props| {
cx.render(rsx! {
{true.then(|| rsx!{ div { "hello" } })}
{false.then(|| rsx!{ div { "goodbye" } })}
@@ -243,7 +243,7 @@ fn anchors() {
#[test]
fn suspended() {
static App: FC<()> = |cx| {
static App: FC<()> = |cx, props| {
let val = use_suspense(
cx,
|| async {