Skip to content

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

Description

@dkremez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions