Conversation
| // Create a proxy constructor with matching name | ||
| ProxyComponent = new Function('factory', 'instantiate', | ||
| `return function ${InitialComponent.name || 'ProxyComponent'}() { | ||
| `return function ${displayName}() { |
There was a problem hiding this comment.
@gaearon this appears to cause an issue with Redux, it tries to evaluate Connect(ComponentName) as a function name and it results in a silent SyntaxError. It only shows up if you run with Pause On Caught Exceptions and no other error in console. Is it necessary to sanitize the function name?
There is a reasonable fallback here. No further action might be necessary.
There was a problem hiding this comment.
Oh yeah, we should sanitize it. Would you like to send a PR against 3.x branch?
I think this will actually make it easier for me to use a Proxy here because this is where I ended up spinning my wheels last time |
|
Oh, cool, would be excited to see that @danmartinez101 😄 |
|
How would you feel about exposing a lifecycle hook for when a proxy is updated? I'm trying to find a nice way of having methods rebind to the instance when using ES6 Classes. |
Changes related to the “wrap during
createElement” approach described here:this.constructor, not the proxy classupdate(), static properties created dynamically on the previous class get copied to the next classExample of this in action: gaearon/react-hot-boilerplate#61