React.PropTypes.shape({
foo: React.PropTypes.string,
bar: React.PropTypes.shape({
fieldNum: React.PropTypes.number
})
})
? I'm not saying it isn't verbose, but I'm pretty sure that as of a few months ago, this existed in React natively.
Good question! Because this is on a hot code path, we were allocating new values faster than the garbage collector was able to remove them. Over extended periods of time, the server would trend toward running out of memory.