在 React Router 中,可以使用子路由通配符来匹配任意子路由。子路由通配符使用 `*` 符号来表示。
以下是一个使用子路由通配符的示例:
```jsx
react router cacheimport React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
const Home = () => <h1>Home</h1>;
const About = () => <h1>About</h1>;
const Contact = () => <h1>Contact</h1>;
constwildcard = () => <h1>wildcard</h1>;
const App = () => (
  <Router>
    <Switch>
      <Route exact path="/" component={Home} />
      <Route path="/about" component={About} />
      <Route path="/contact" component={Contact} />
      <Route path="/*" component={wildcard} />
    </Switch>
  </Router>
);
export default App;
```
在上面的示例中,我们定义了三个路由:`/`, `/about`, 和 `/contact`。然后我们使用了一个通配符路由 `/*` 来匹配所有其他子路由。这意味着,当用户访问除了 `/`, `/about`, 和 `/contact` 以外的任何路径时,都会渲染 `wildcard` 组件。