Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x fails when the class contains non-configurable properties #61

Open
gaearon opened this issue May 1, 2016 · 3 comments
Open

3.x fails when the class contains non-configurable properties #61

gaearon opened this issue May 1, 2016 · 3 comments
Labels

Comments

@gaearon
Copy link
Owner

gaearon commented May 1, 2016

We should add a try-catch there or be more careful copying descriptors.

@gaearon gaearon added the bug label May 1, 2016
@danibrear
Copy link

Hey Dan, I wanted to try my hand at this, do you mind adding a little bit more information about how you're getting it to fail?

@gaearon
Copy link
Owner Author

gaearon commented Jun 11, 2016

I think something like this

class Stuff extends Component {
  render() { return <div /> }
}
Object.defineProperty(Stuff, {
  configurable: false,
  value: 42
})

and try to patch that up with a new version. I think you can tweak static-descriptors test cases to repro this.

@dbo
Copy link

dbo commented Jan 2, 2017

Excuse my ignorance, but shouldn't this issue also cover non-writable properties like prototype.constructor? I am defining the constructor property as read only out of good habit. Hot reloading breaks when it is patched here: https://github.com/gaearon/react-proxy/blob/next/src/createClassProxy.js#L216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants