Closed elhoucine closed 6 years ago
Hey, as for the dom elements, react-stoon would need a wrapper for the component for it to work, something like:
const Img = (props) => <img ...props />;
<Show $={Img} if={imageLink != ""}>
<Img src={imageLink} />
</Show>
which is basically a limitation or a bug to fix in a future version.
as for your second point, I agree it's a little bit confusing, but actually pretty concise.
the most important thing is that the user would enjoy using these helpers that's why choosing either approach is very important, we would need to host a poll for which one to go for in the next releases,
and if we are to support both how could we do it? maybe if $
is null then behave as suggested?
let's keep this open until we decide on this.
Hi @Amine-H,
Let me know when you host a poll I'll be happy to participate.
Hey, @elhoucine
following our discussion and considering that the poll resulted in favor of the proposed approach, we'll tag this Issue in the commit when merging it.
Thanks for your collaboration!
Links https://web.facebook.com/groups/137841990252945/permalink/162664217770722/
Hi! nice idea đ đĽ
I tried the Show helper and here are some thoughts:
Show
only work for React components, For example, this will not work:And while it works well for Components, the
Show
syntax mixes with the application logic đ˘ For example, JS conditional:After applying
Show
helper:In the code above
Show
dominated the component & it's props đ instead, we could have this:In the last syntaxe
Show
will only decide if or not to render, without taking care of props or other stuff.It would be cool if
Show
works only as a conditional helper & for both React and Dom elements.Let me know what you think.