fac-14 / OSCEBossKey

Weeks 13-16 > Tech for Better project: An app to help medical students revise for their exams
https://oscebosskey.herokuapp.com/
MIT License
3 stars 2 forks source link

Use functional components where possible #154

Open tbtommyb opened 5 years ago

tbtommyb commented 5 years ago

If you have React components that only call render you can express this more succinctly (and React runs them faster) as a functional component:

const BackButton = ({ link }) => (
  <Link to={link}>
    ...
  </Link>
);

Destructing the props argument is a super-common React pattern that can clean up your code quite a lot.