title: Getting initial state with Redux in typescript
body: <p>I'm having a hard time with typescript, in particular Microsoft's dotnet new react-redux.</p>
  
  <p>I am trying to call an action on startup to find out if a user is logged in or not, but typescript doesn't like it and I don't understand the error.</p>
  
  <p>Here is the Layout code:</p>
  
  <pre><code>import * as React from "react";
  import { NavMenu } from "./NavMenu";
  import { connect } from "react-redux";
  import * as AuthStore from "../store/Auth";
  
  type LayoutProps = typeof AuthStore.actionCreators;
  
  class Layout extends React.Component&lt;LayoutProps, {}&gt; {
    componentDidMount() {
      this.props.getLoggedInUser();
    }
    public render() {
      return (
        &lt;div className="container-fluid"&gt;
          &lt;div className="row"&gt;
            &lt;div className="col-sm-3"&gt;
              &lt;NavMenu /&gt;
            &lt;/div&gt;
            &lt;div className="col-sm-9"&gt;{this.props.children}&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default connect(null, AuthStore.actionCreators)(Layout) as typeof Layout;
  </code></pre>
  
  <p>And this is the routes code which is causing the issue.</p>
  
  <pre><code>import * as React from "react";
  import { BrowserRouter, Route } from "react-router-dom";
  import Layout from "./components/Layout";
  import Home from "./components/Home";
  import FetchData from "./components/FetchData";
  import Counter from "./components/Counter";
  import SignUp from "./components/SignUp";
  import SignIn from "./components/SignIn";
  
  export const routes = (
    &lt;Layout&gt;
      &lt;div&gt;
        &lt;Route exact path="/" component={Home} /&gt;
        &lt;Route path="/counter" component={Counter} /&gt;
        &lt;Route path="/fetchdata/:startDateIndex?" component={FetchData} /&gt;
        &lt;Route path="/signup" component={SignUp} /&gt;
        &lt;Route path="/signin" component={SignIn} /&gt;
      &lt;/div&gt;
    &lt;/Layout&gt;
  );
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>TS2322: Type '{ children: Element; }' is not assignable to type 'IntrinsicAttributes &amp; IntrinsicClassAttributes&lt;Layout&gt; &amp; Readonly&lt;{ children?: ReactNode; }&gt; &amp; Re...'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/iEv77.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iEv77.png" alt="error"></a></p>