title: reference to Component stored in localstorage is undefined on refresh
body: <p>I have a component <code>Widget</code> which takes a reference to a Component class and its properties as props and renders it.</p>
  
  <p>This widget is rendered from a <code>WidgetList</code> Component which maps over the list of widgets which it stores in its state, as well as keeps the list updated in <code>localStorage</code> so that it can be persistent across reload.</p>
  
  <pre><code>class WidgetList extends React.Component {
    constructor(props) {
      super(props);
      const storedWidgets = JSON.parse(localStorage.getItem('widgets')) || null;
      this.state = {
        widgets: storedWidgets
      }
    }
  
    onChange(updatedWidgets) {
      localStorage.setItem('widgets', JSON.stringify(updatedWidgets));
      this.setState({ widgets: updatedWidgets });
    }
  
    render() {
      &lt;div&gt;
        {widgets.map(widget =&gt; (
            &lt;div key={widget.id}&gt;
              &lt;Widget data={widget.data} /&gt;
            &lt;/div&gt;
          ))}
      &lt;/div&gt;
    }
  }
  
  
  const Widget = (props) =&gt; {
    const { component: Component, properties } = props.data;
    console.log(Component, properties)
    return &lt;Component {...properties} /&gt;;
  };
  </code></pre>
  
  <p>The problem is that when I render this, it works fine but on refresh it fails. And the <code>console.log</code> returns <code>undefined</code> for <code>Component</code> and the correct object for <code>properties</code>.</p>
  
  <p>I think the problem is that the component is not getting re-imported, but I don't understand how to get around the issue.</p>