Closed 9876691 closed 2 years ago
Could use Box::new or the https://doc.rust-lang.org/nightly/unstable-book/language-features/box-syntax.html keyword; potentially even use a tab(markup::new! {}) function to return a wrapped Raw type.
Hey @ianpurton, did you manage to figure out a solution? Box<dyn Render>
will not work as the trait is not object-safe because its render
function takes a generic argument (for performance reasons).
I pushed some changes in https://github.com/utkarshkukreti/markup.rs/commit/694f02141feea67b415cc44b91f27c102037ba8f to address this.
You can try it out by adding a dependency on the latest git commit.
I'm still thinking of a better name than DynRender
for the struct before making a release.
I'd like to build a nested tabs component. Something like
So a component, with a list of nested sub components.
I tried a few different things, something like
But that doesn't compile. I guess I could pass around the Tab elements as a string, but ideally I"d like the type safety.
Any ideas?