Skip to content

dash-case props in components? #2588

Closed Answered by gbj
s1n7ax asked this question in Q&A
May 11, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Props are just a struct, so each prop is a struct field name. Rust identifiers can't have dashes (as far as I know) so struct field names/prop names can't have dashes.

I guess in theory it's possible to modify the view macro so that it rewrites any dash-cased prop names to snake_case but it just seems like an extra layer of confusion to me.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s1n7ax
Comment options

@gbj
Comment options

gbj May 13, 2024
Maintainer

Answer selected by s1n7ax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants