From 6913c994152f0cd3988a3ceb5d3c6a4d0bd0d543 Mon Sep 17 00:00:00 2001 From: Gurpal Singh Date: Fri, 24 Jun 2022 22:59:13 +0530 Subject: [PATCH] remove default classNames from elements --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/create_component_files.rs | 22 ++++++---------------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c841345..b2a4202 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,7 +168,7 @@ dependencies = [ [[package]] name = "react" -version = "0.1.0" +version = "1.2.1" dependencies = [ "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index 42ab3b5..b3b72f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "react" -version = "0.1.0" +version = "1.2.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/create_component_files.rs b/src/create_component_files.rs index 6aeb360..e50e10d 100644 --- a/src/create_component_files.rs +++ b/src/create_component_files.rs @@ -8,7 +8,7 @@ pub mod files_creater { is_class_component: bool, ) { let index_file_content = format!( - "export {{ default }} from \"./{}\";", + "export * from \"./{}\";", component_name.split(".").collect::>()[0] ); let css_file_content; @@ -22,14 +22,9 @@ pub mod files_creater { ) } else { component_file_content = format!( - "import styles from './{:}'; - export default function {:}() {{ - return ( -
-

Hello World

-
- ); - }} + "import styles from './{:}';\nexport default function {:}() {{\n\t\treturn (\n\t\t\t
\n\t\t\t\t

Hello World

\n\t\t\t
+) +}} ", stylesheet_name, component_name.split(".").collect::>()[0] @@ -44,13 +39,8 @@ pub mod files_creater { ) } else { component_file_content = format!( - "import './{:}'; - export default function {:}() {{ - return ( -
-

Hello, world!

-
- ); + "import './{:}';\nexport default function {:}() {{\n\t\treturn (\n\t\t\t
\n\t\t\t\t

Hello, world!

\n\t\t
+); }} ", stylesheet_name,