Get query parameters in React, Typescript
<p>I have a component that looks like this:</p>

<pre><code>class MyView extends React.Component&lt;{}, {}&gt; {
    render() {
        console.log((this.props as any).params); // prints empty object
        return (
            &lt;div&gt;Sample&lt;/div&gt;
        );
    }
}
</code></pre>

<p>I want to print the URL query params but I get an empty object.
(Yes, I know that I declared {} as Props but if I don't define it, it does not compile).</p>

<p>Is there a way to pass a "default" props object to my component so that I can access <code>this.props.params</code>? Or should it be done in a different way in TypeScript?</p>