material-yew icon indicating copy to clipboard operation
material-yew copied to clipboard

No `MatButton` in the root

Open mistricky opened this issue 3 years ago • 8 comments

I have add material-yew as dependencies in my Cargo.toml:

[dependencies]
yew = "0.18.0"
wasm-bindgen = "0.2.67"
material-yew = "0.1.0"
yew-router = "0.15.0"

And then I'm use the MatButton from material-yew in my rust file

use material_yew::MatButton;

but I get the following error

unresolved import `material_yew::MatButton`

no `MatButton` in the rootrustc(E0432)

Am I missing something?

mistricky avatar Jun 27 '21 08:06 mistricky

I'm trying to pull material-yew by git repo way, that's working for me. but Idk why? when I define the version of material-yew directly, I can't use any component in my project.

mistricky avatar Jun 27 '21 09:06 mistricky

You have to enable the required feature.

I really should remove the feature locks as wasm bindgen just doesn't fetch what isn't used. Presumably because rustc just removes that code.

ranile avatar Jun 27 '21 09:06 ranile

how to do that?

You have to enable the required feature.

I really should remove the feature locks as wasm bindgen just doesn't fetch what isn't used. Presumably because rustc just removes that code.

santokalayil avatar Feb 22 '22 05:02 santokalayil

@santokalayil see cargo features

ranile avatar Feb 22 '22 18:02 ranile

@hamza1311 i know how to use cargo features. the question is which are options that are to be included

what is the relevant required feature to get rid of this error

santokalayil avatar Feb 23 '22 14:02 santokalayil

Enable the full feature

ranile avatar Feb 23 '22 14:02 ranile

Enable the full feature

[features] full = []

? how is it

santokalayil avatar Feb 23 '22 14:02 santokalayil

material-yew = { version = "0.1.0", features = ["full"] }

This is how you enable the feature

ranile avatar Feb 23 '22 17:02 ranile