ESLint React-Router v4 - How to validate Match params props? : <p>I'm using React-Router v4's <a href="https://reacttraining.com/react-router/web/api/match" rel="noreferrer">Match object</a> to pass down params to the next component. Where my Routing is like:</p>

<pre><code>&lt;Switch&gt;
  &lt;Route exact path="/" component={ExperimentListPage} /&gt;
  &lt;Route path="/experiment/:experiment" component={ExperimentResultsPage} /&gt;
&lt;/Switch&gt;
</code></pre>

<p>and my subcomponent looks like:</p>

<pre><code>const ExperimentResultsPage = props =&gt; (
   &lt;ExperimentResultsContainer experimentName={props.match.params.experiment} /&gt;
);

export default withRouter(ExperimentResultsPage);
</code></pre>

<p>And it all works as intended, however ESLint is really unhappy with me using <code>match.params.experiment</code> and it errors with <code>[eslint] 'match.params.experiment' is missing in props validation (react/prop-types)</code></p>

<p>I saw in the React docs that I could use <a href="https://facebook.github.io/react/docs/typechecking-with-proptypes.html" rel="noreferrer"><code>PropTypes.shape</code></a> however my params object but I was hoping there is a better way especially because the Match object contains a lot of fields.</p>

<p>Is there a better way of adding your Match route object to the props validation? How would that look like? If not, am I missing some other approach that could help solve this?</p>
