title: d3.js select by id not working. Not sure why not
body: <p>I'm not sure why this is not working but in my App.tsx I do</p>
  <pre><code>return(
   &lt;div id=&quot;expander&quot;&gt;
          &lt;button onClick={handleClick}&gt; This is a button &lt;/button&gt;
          &lt;div id=&quot;button1&quot;&gt;
  
          &lt;/div&gt;
          { clicked &amp;&amp; &lt;Visualize name=&quot;someName&quot;/&gt;}
  &lt;/div&gt;
  )
  </code></pre>
  <p>So I clearly define a div with id of button1</p>
  <p>Then in visualize I do</p>
  <pre><code>var selectDiv=d3.select('#button1')
              var svg = selectDiv.select('svg'),
                  inner = svg.select('g');
   var render = new dagreD3.render();
              // // Run the renderer. This is what draws the final graph.
              render(inner, g);
  
   render()
          {
              return (
                  &lt;div&gt;
                      &lt;svg className={this.props.name}&gt;
                          &lt;g/&gt;
                      &lt;/svg&gt;
                  &lt;/div&gt;
              );
          }
  </code></pre>
  <p>The structure of the HTML elements is
  <a href="https://i.stack.imgur.com/Vq8q1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vq8q1.png" alt="enter image description here" /></a></p>