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

Can't close modal, when put my own component inside Modal component #4

Open
dkremez opened this issue Jul 29, 2015 · 1 comment
Open

Comments

@dkremez
Copy link

dkremez commented Jul 29, 2015

Hi I see error message

Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's `render` method). Try rendering this component inside of a new top-level component which will hold the ref.

Uncaught TypeError: Cannot read property 'componentWillLeave' of undefined

when I try to use code like this

<Modal transitionName='fade' closeOnEsc={true} closeOnOutsideClick={true} close={this.closeModal}>
  <MyComponent />
</Modal>

So the problem is that I can't close modal window.

@dkremez
Copy link
Author

dkremez commented Jul 29, 2015

I've solved problem by removing all refs from my own component, but still have problem because it is form component with a lot of inputs that is hard to manage without refs.

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

1 participant