Skip to content

Commit

Permalink
remove default classNames from elements
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantomKnight287 committed Jun 24, 2022
1 parent c6d4fa5 commit 6913c99
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
22 changes: 6 additions & 16 deletions src/create_component_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<&str>>()[0]
);
let css_file_content;
Expand All @@ -22,14 +22,9 @@ pub mod files_creater {
)
} else {
component_file_content = format!(
"import styles from './{:}';
export default function {:}() {{
return (
<div className={{styles.h1Container}}>
<h1>Hello World</h1>
</div>
);
}}
"import styles from './{:}';\nexport default function {:}() {{\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h1>Hello World</h1>\n\t\t\t</div>
)
}}
",
stylesheet_name,
component_name.split(".").collect::<Vec<&str>>()[0]
Expand All @@ -44,13 +39,8 @@ pub mod files_creater {
)
} else {
component_file_content = format!(
"import './{:}';
export default function {:}() {{
return (
<div className=\"h1Container\" >
<h1>Hello, world!</h1>
</div>
);
"import './{:}';\nexport default function {:}() {{\n\t\treturn (\n\t\t\t<div >\n\t\t\t\t<h1>Hello, world!</h1>\n\t\t</div>
);
}}
",
stylesheet_name,
Expand Down

0 comments on commit 6913c99

Please sign in to comment.