* Fix race condition that's causing preview/console and code to be out of sync (#990) * Refactor * Fix undefined prop error