Open tigerros opened 8 months ago
We should also replace #[inline_props] with #[component]
I already did that, make sure you have the latest changes in your branch
add #[component] for components
I really dislike the idea of using the component macro for all the components, last time I tried it looked very verbose for large components such as ScrollView
I really dislike the idea of using the component macro for all the components, last time I tried it looked very verbose for large components such as ScrollView
Really? It's just one attribute. You might be thinking of inlining all props, but the macro doesn't require that. It would just enforce some component standards. Also, I thought you wanted the documentation...
You might be thinking of inlining all props, but the macro doesn't require that.
Ah, it doesn't? then it's fine!
Oh it also suppresses the non_snake_case
warning, which is everywhere.
Depends on https://github.com/DioxusLabs/dioxus/pull/2289 because Freya uses the struct pattern syntax (fn Foo(FooProps { bar }: FooProps)
) which is not supported right now
I know marc wanted the properties to be documented at the component function, which the new Dioxus 0.4.3
#[component]
macro does (if inlined props are used). I think inline props should always be available (i.e. we shouldn't ever need a separate struct), since I made some parsing improvements to the macro. See https://github.com/DioxusLabs/dioxus/pull/1565 for how this may look like.We should also replace
#[inline_props]
with#[component]
, and add#[component]
for components that have struct props to enforce UpperCamelCase names and some other stuff.