add example code

https://github.com/reactjs/react-tutorial/blob/master/public/scripts/example.js