Search code examples
rustwebassemblyyew

How do I fix material-yew use declaration?


I tried to do a hello world with material-yew.

I tried to add this use declaration according to Material Yew's home page.

use material_yew::MatButton;

I've also tried this version that I've also seen in the docs:

use material_yew::button::MatButton;

But both of them give a similar error:

error[E0432]: unresolved import material_yew::MatButton

I have these in my Cargo.toml:

[dependencies]
yew = "0.19.3"
material-yew = "0.2.0"

And I'm using trunk serve to run the app.


Solution

  • You need to enable the button feature (or the full feature that implies it):

    material-yew = { version = "0.2.0", features = ["button"] }