The log function in the API runs JSON.stringify on the argument, unlike console.log. w and z in your gist are both functions, which aren't valid JSON, so they come out undefined. See it in an interactive console, for example: > JSON.stringify(() => ({})) < undefined JSON.stringify is also used on values stored in the state object when it's serialized, meaning you can't store functions directly in state. In both cases, you can call toString on the function to log (or store) the string representation of the function: > JSON.stringify((() => ({})).toString())
< ""() => ({})""