Closed cecton closed 1 year ago
@WorldSEnder yes you're mixing up with IntoPropValue I think.
In Yew, ImplicitClone allows giving references to props so they are automatically cloned. For example:
let Props { my_array: list } = &ctx.props();
// ...
<ListComponent {list} />
(so ImplicitClone extends over Copy as more type can be implicitly cloned)
Adding primitives to ImplicitClone allows nesting types because IArray<T>
requires that T: ImplicitClone
.
It's not exactly the same use case.
Merging this for now before I forget that PR exists lol
Any primitive type that implements Copy should also implement ImplicitClone. It would be nice if it was possible to tell Rust that but I couldn't manage to do it. If anyone wants to give it a try...
https://github.com/yewstack/implicit-clone/pull/9#issuecomment-1198598528
In the meantime, here is a small PR for adding char so it's possible to make a type
IArray<char>
.