DEV Community

Create Simple Popup Example In React Application

skptricks on January 13, 2019

Source : Create Simple Popup Example In React Application In this tutorial we will see how to create simple popup in react applicat...
Collapse
 
jkholodnov profile image
Jason • Edited

Thanks for this - one minor change that is recommended by ESlint is to put the function binding in the constructor of the App component. ie:

class App extends React.Component {
  static propTypes = {
    accounts: PropTypes.arrayOf(PropTypes.object).isRequired,
    options: PropTypes.objectOf(PropTypes.any).isRequired,
    actions: PropTypes.func.isRequired,
  };

  constructor(props) {
    super(props);
    this.state = { showPopup: false };
    this.togglePopup = this.togglePopup.bind(this);
  }

  togglePopup() {
    this.setState({
      showPopup: !this.state.showPopup,
    });
  }

Collapse
 
emadsaber profile image
emadsaber

Thanks for your post, what about making use of some advanced library like jQuery UI, how can I use it with React?