An optimized version of the React demo. Thanks to @petehunt for his suggestions!