Skip to content

Commit 3238bb5

Browse files
committed
Change the #[function_component] macro to #[component] by default
1 parent fd44a44 commit 3238bb5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/communication_grandchild_with_grandparent/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ mod grandparent;
99
mod parent;
1010

1111
use yew::{
12-
component, html, AttrValue, Callback, Component, Context, ContextHandle,
13-
ContextProvider, Html, Properties,
12+
component, html, AttrValue, Callback, Component, Context, ContextHandle, ContextProvider, Html,
13+
Properties,
1414
};
1515

1616
/// This is the shared state between the parent and child components.

packages/yew-macro/src/function_component.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ impl Parse for FunctionComponent {
3535
item => {
3636
return Err(syn::Error::new_spanned(
3737
item,
38-
"the `component` or `function_component` attribute can only be applied to functions",
38+
"the `component` or `function_component` attribute can only be applied to \
39+
functions",
3940
))
4041
}
4142
};

0 commit comments

Comments
 (0)