Skip to content

Refs object is not extensible #123

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

Closed
ethul opened this issue Nov 14, 2017 · 0 comments · Fixed by #125
Closed

Refs object is not extensible #123

ethul opened this issue Nov 14, 2017 · 0 comments · Fixed by #125
Assignees

Comments

@ethul
Copy link
Contributor

ethul commented Nov 14, 2017

Writing a ref causes:

Uncaught TypeError: Cannot add property <a>, object is not extensible

I believe that refs is a frozen object now. Related issue facebook/react#7136.

To fix this, I propose that we just write the refs directly to this as suggested in the linked issue above. I am open to other ideas though.

react@16.0.0
purescript-react@5.0.0

@ethul ethul self-assigned this Nov 14, 2017
ethul added a commit that referenced this issue Nov 19, 2017
ethul added a commit that referenced this issue Nov 21, 2017
Fixes #123

Using the `ref` prop writes the ref to the `this.refs` object.

However, setting a ref with a callback is not allowed to write to the frozen `this.refs`. The `writeRef` props writes directly to `this` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant