title: How to import a component or file in React using variables?
body: <p>I'm building a web app using React that shows the blueprint for the building you select, in an already selected campus.</p>
  
  <p>I have a "Content" component that loads the campus or building map, depending what you chose.
  The "BuildingMap" component needs to load a specific blueprint according to what building you selected. It gets the <em>props.building</em> with the name of the building but I don't know how to load a component using that variable.</p>
  
  <p>I have tried import, fetch and require but nothing seems to work.</p>
  
  <p>Please help.</p>
  
  <p>My code looks something like this:</p>
  
  <p>//Content Component</p>
  
  <pre><code>&lt;BuildingMap building={selectedBuilding} campus={selectedCampus} /&gt;
  </code></pre>
  
  <p>//BuildingMap Component</p>
  
  <pre><code>import *MyBlueprint* from (specific folder depending on the campus selected)
  
  class BuildingMap extends React.Component {
    render(){
      return (
        &lt;div className="blueprint" id={this.props.building}&gt;
           {*MyBlueprint*}
        &lt;/div&gt;
      )
    }
  }
  </code></pre>