Update refs example code to use onChange

Fixes #1408.

Test Plan: Copy each code snippet into jsbin; type in the text box successfully; click the button and see the input clear (and in the second example, get focused).