thedodd / ybc

A Yew component library based on the Bulma CSS framework.
Apache License 2.0
258 stars 37 forks source link

Impossible to instantiate ybc::Input as `type` is a prohibited identifier #19

Closed Moxinilian closed 3 years ago

Moxinilian commented 3 years ago

While trying to instantiate an Input component with a custom type, as the struct uses a field name type that conflicts with the Rust reserved type keyword, the macro gets confused and refuses to build. I might be misusing it here, but I can't find a way around it beyond renaming it in the props struct.

thedodd commented 3 years ago

Hello there. In Rust, the way you deal with that is as follows: r#type. This allows you to use any identifier, even those reserved for language purposes.

Moxinilian commented 3 years ago

I recall trying this but it still not building on latest Rust at the time. Unfortunately I don't have this project anymore to check this.