Skip to content

Commit

Permalink
Change the #[function_component] macro to #[component] by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tdooms committed Oct 5, 2023
1 parent fd44a44 commit 3238bb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ mod grandparent;
mod parent;

use yew::{
component, html, AttrValue, Callback, Component, Context, ContextHandle,
ContextProvider, Html, Properties,
component, html, AttrValue, Callback, Component, Context, ContextHandle, ContextProvider, Html,
Properties,
};

/// This is the shared state between the parent and child components.
Expand Down
3 changes: 2 additions & 1 deletion packages/yew-macro/src/function_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ impl Parse for FunctionComponent {
item => {
return Err(syn::Error::new_spanned(
item,
"the `component` or `function_component` attribute can only be applied to functions",
"the `component` or `function_component` attribute can only be applied to \
functions",
))
}
};
Expand Down

0 comments on commit 3238bb5

Please sign in to comment.