fix: 修复新版react-router 启动报错

This commit is contained in:
liaoxuezhi 2024-05-22 15:01:35 +08:00
parent bbb1d64c35
commit 9c28e2e842
2 changed files with 355 additions and 361 deletions

View File

@ -141,8 +141,7 @@ class BackTop extends React.PureComponent {
);
}
}
// @ts-ignore
@withRouter // @ts-ignore
export class App extends React.PureComponent<{
location: Location;
}> {
@ -864,7 +863,6 @@ export function navigations2route(
export default function entry() {
// PathPrefix = pathPrefix || DocPathPrefix;
return (
<Router>
<Switch>

View File

@ -31,8 +31,7 @@ export default function (schema, schemaProps, showCode, envOverrides) {
};
}
return withRouter(
class extends React.Component {
return class extends React.Component {
static displayName = 'SchemaRenderer';
iframeRef;
state = {open: false, schema: {}};
@ -396,9 +395,7 @@ export default function (schema, schemaProps, showCode, envOverrides) {
// <i className="fa fa-copy p-l-xs"></i>
// </div>
// </div>
<Portal
container={() => document.getElementById('Header-toolbar')}
>
<Portal container={() => document.getElementById('Header-toolbar')}>
<div className="hidden-xs hidden-sm ml-3">
<div>
<div className="Doc-headingList">
@ -420,6 +417,5 @@ export default function (schema, schemaProps, showCode, envOverrides) {
</>
);
}
}
);
};
}