2 ms·
Thats interesting. So in your 2nd example, am I right in saying the variables 'apple' and 'slicedApple' are react JSX that you are ultimatly passing through to
by masterofmisc 5y ago
Thats interesting. So in your 2nd example, am I right in saying the variables 'apple' and 'slicedApple' are react JSX that you are ultimatly passing through to <DinnerPlate/> to render on the screen? If so, yes, that is fairly intuitive.
- thatswrong0 5y ago'apple' and 'slicedApple' would more likely be strings / objects / arrays in the real world. Maybe this still woefully contrived version is clearer? function FacebookComment({ commentId }) { const comment = useGetComment(commentId); const likes = useGetLikes(comment); return ( <div> <span>{comment.text}</span> <span>{likes.length} likes</span> </div> ); } I don't think deal with more braces right now to bring the alternative into existence unfortunately
- masterofmisc 5y agoOhh i see. Yes, that makes sense. Thanks for taking the time to reply.