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

sanitizeProps causes error #160

Closed
suprsidr opened this issue Apr 14, 2016 · 8 comments
Closed

sanitizeProps causes error #160

suprsidr opened this issue Apr 14, 2016 · 8 comments

Comments

@suprsidr
Copy link

suprsidr commented Apr 14, 2016

Summary:

Uncaught TypeError: Cannot delete property 'ref' of #<Object>

Steps to reproduce:

  1. open modal
  2. Uncaught TypeError: Cannot delete property 'ref' of #<Object>
    Modal.js line 78 sanitizeProps(props) -> line 115 delete props.ref;

Additional notes:

if I comment out the call to sanitizeProps all is good.

just upgraded to react 15.0.1 and react-dom 15.0.1
Worked fine prior

@diasbruno
Copy link
Collaborator

@suprsidr awesome! i'll check it.

@rmertens
Copy link

Getting the same error (also react 15.0.1)!

@diasbruno
Copy link
Collaborator

diasbruno commented Apr 18, 2016

@suprsidr @rmertens can you make a simple example were you can reproduce it?

@rmertens
Copy link

@wikiwong
Copy link

No mean to clutter, but I am getting the same error as well. Feel free to tag me for any additional info I can provide.

Thanks for looking into this guys!

@diasbruno
Copy link
Collaborator

diasbruno commented Apr 19, 2016

If sanitizeProps(props) is moved to Modal::componentWillReceiveProps(), it works fine.

react: 15.0.1, react-dom: 15.0.1, react-modal: 1.1.1

Is there a reason to sanitizeProps() is called in Modal::renderPortal()? @claydiffrient

Some info from react docs:

Never access refs inside of any component's render method – or while any component's render method is even running anywhere in the call stack.

react/docs - Ref to Components

@diasbruno
Copy link
Collaborator

Also tested with react: 15.0.0, react-dom: 15.0.0, react-modal: 1.1.1 and works fine.

@claydiffrient
Copy link
Contributor

claydiffrient commented Apr 19, 2016

Fix released as v1.1.2

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

No branches or pull requests

5 participants