Meta interview question

Optimizing a code snippet from one of their projects Implementing render from ReactDom