wip: rename fc to component

This commit is contained in:
Jonathan Kelley committed 2021-12-09 21:19:31 -05:00
1 parent 85ab8b91c6
commit 1e4a599d14
61 files changed
+524 -145

No files matched your search

+6 -6
View File
@@ -19,7 +19,7 @@ use DomEdit::*;
#[test]
fn app_runs() {
static App: FC<()> = |cx, props| rsx!(cx, div{"hello"} );
static App: Component<()> = |cx, props| 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: FC<()> = |cx, props| {
static App: Component<()> = |cx, props| {
cx.render(rsx!(
div{"hello"}
div{"goodbye"}
@@ -41,7 +41,7 @@ fn fragments_work() {
#[test]
fn lists_work() {
static App: FC<()> = |cx, props| {
static App: Component<()> = |cx, props| {
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: FC<()> = |cx, props| {
static App: Component<()> = |cx, props| {
cx.render(rsx!(
h1 {"hello"}
{true.then(|| rsx!(span{ "a" }))}
@@ -87,13 +87,13 @@ fn conditional_rendering() {
#[test]
fn child_components() {
static App: FC<()> = |cx, props| {
static App: Component<()> = |cx, props| {
cx.render(rsx!(
{true.then(|| rsx!(Child { }))}
{false.then(|| rsx!(Child { }))}
))
};
static Child: FC<()> = |cx, props| {
static Child: Component<()> = |cx, props| {
cx.render(rsx!(
h1 {"hello"}
h1 {"goodbye"}