mik*_*kek 5 typescript reactjs react-router-dom react-testing-library
我正在针对以下组件运行测试:
const App: React.FC<RouteComponentProps> = ({ history, location, match }) => { ... }
Run Code Online (Sandbox Code Playgroud)
所有的测试都通过了,但是我收到了这个警告:
const { getByText, debug } = render(<MemoryRouter><Route><App/></Route></MemoryRouter>);
Type '{}' is missing the following properties from type 'RouteComponentProps<{}, StaticContext, {}>': history, location, match(2739)
Run Code Online (Sandbox Code Playgroud)
我的印象是<MemoryRouter>&<Route>会提供<App/>缺少的属性......
| 归档时间: |
|
| 查看次数: |
230 次 |
| 最近记录: |