Skip to content

Question: Why doesn't react-modal use imperative style? #757

Open
@Webbrother

Description

@Webbrother

Summary:

Why doesn't react-modal use imperative style?

I mean, following:

class MyComponent extends Component {
  constructor() {
    super();
    ...
    this.modal = ...
    ...
    this.handleClick = this.handleClick.bind(this);
  }
  
  handleClick() {
    this.modal.open(<div>Some content of modal.</div>);
  }
  
  render() {
    return (<button onClick = {this.handleClick} >Click me to open modal</button>);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions