title: How to replace a pure component with shouldComponentUpdate in react
body: <p>I have the following react component.</p>
  
  <pre><code>import React, { Component } from 'react';
  
  import Backdrop from 'components/ui/backdrop/backdrop.component';
  
  class BaseModal extends Component {
    shouldComponentUpdate(nextProps: INextProps) {
      return nextProps.show !== this.props.show || nextProps.children !== this.props.children;
    }
  
    render() {
      const { show, modalClosed } = this.props;
  
      return (
        &lt;div&gt;
          &lt;Backdrop show={show} onClick={modalClosed} /&gt;
  
          &lt;div
            className='modalClass'
            style={{
              transform: show ? 'translateY(0)' : 'translateY(-100vh)',
              opacity: this.props.show ? '1' : '0',
            }}&gt;
            &gt;{this.props.children}
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  
  interface IProps {
    show: boolean;
    modalClosed: boolean;
    children: any;
  }
  
  interface INextProps {
    show: boolean;
    children: any;
  }
  
  export default BaseModal;
  </code></pre>
  
  <p>I would like to use a pure component here. Does that mean that I can remove the shouldComponentUpdate life cycle method from this component? If so, how should I do it?</p>