Can you do a functional rewrite of this in React JSX?