title: ReactJS Call a function in render after an action
body: <p>I'm using ReactJS, and shopify's polaris in order to create a website. I'm very new to react so this might be a newbie question but I looked over the internet and couldn't manage to put the pieces together. </p>
  
  <p>I have a dropdown list and basically whenever the user clicks on an item from a list I want to add a button next to the dropdown. Here is my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from "react";
  import { ActionList, Button, List, Popover } from "@shopify/polaris";
  
  export default class ActionListExample extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        active: false,
        title: "Set Period",
      };
    }
  
  renderButton() {
      console.log("Button clicked")
      return (
        &lt;div&gt;
          &lt;Button fullWidth={true}&gt;Add product&lt;/Button&gt;;
        &lt;/div&gt;
      );
   }
  
  togglePopover = () =&gt; {
  this.setState(({ active }) =&gt; {
    return { active: !active };
  });
  };
  
  render() {
    const activator = (
      &lt;Button onClick={this.togglePopover}&gt;{this.state.title}&lt;/Button&gt;
    );
  return (
    &lt;div style={{ height: "250px" }}&gt;
      &lt;Popover
        active={this.state.active}
        activator={activator}
        onClose={this.togglePopover}
      &gt;
        &lt;ActionList
          items={[
            {
              content: "One",
              onAction: () =&gt; {
                this.setState({ title: "One" }, function() {
                  this.togglePopover();
                  this.renderButton() //THIS IS WHERE I CALL THE METHOD
                });
              }
            }
          ]}
        /&gt;
      &lt;/Popover&gt;
    &lt;/div&gt;
  );
  }
  }
  </code></pre>
  
  <p>I've placed a comment in the code to show where I call the renderButton() method. Whenever I click the "One" element in the dropdown, it prints out "Button clicked" but nothing gets rendered to the screen. Any help is greatly appreciated. Thanks in advance!</p>