Hacker News new | ask | show | jobs
by masterofmisc 1576 days 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.
1 comments

'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
Ohh i see. Yes, that makes sense. Thanks for taking the time to reply.