Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That ~30 line component should be reduced to something resembling this:

  const PlanetView = ({planet}) => <div>{planet ? planet.stuff : 'Loading...'}</div>


It's demonstrating a component that needs I/O, so I'm not sure how refactoring it into one that needs its parent to do the I/O helps the demonstration.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: