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

Add setters for bound methods #29

Closed
wants to merge 1 commit into from

Conversation

Rogeres
Copy link

@Rogeres Rogeres commented May 5, 2016

Hello.
I want to use the @autobind decorator with this awesome React babel plugin by @gaearon

https://github.com/gaearon/react-transform-catch-errors

But when the page loads I get Cannot set property render of #<Component> which has only a getter error in the console.

The fix is to add a setter (see the code).

},
set(value) {
Object.defineProperty(this, key, {
value: value
Copy link
Collaborator

@stevemao stevemao Sep 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need

configurable: true,
writable: true

in the above code?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to have been abandoned. I suggest making the changes to the PR or a new PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mosho1 A new PR sounds good. What about #42 ? Could you comment on that PR? Thanks for your help.

@srolel
Copy link

srolel commented Dec 9, 2016

I would love this for testing!

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

Successfully merging this pull request may close these issues.

None yet

3 participants