mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Add react-router-dom-v5-compat (#159173)
## Summary Prep work for bumping react-router to v6 Following https://github.com/remix-run/react-router/discussions/8753 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
2fba1b651e
commit
09577fa0af
42 changed files with 715 additions and 613 deletions
|
@ -9,6 +9,7 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Router, Redirect } from 'react-router-dom';
|
||||
import { CompatRouter } from 'react-router-dom-v5-compat';
|
||||
import { Route } from '@kbn/shared-ux-router';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { AppMountParameters, CoreStart } from '@kbn/core/public';
|
||||
|
@ -48,30 +49,32 @@ export const renderApp = (
|
|||
<RedirectAppLinks application={application}>
|
||||
<SearchExamplePage exampleLinks={LINKS} basePath={http.basePath}>
|
||||
<Router history={history}>
|
||||
<Route path={LINKS[0].path}>
|
||||
<SearchExamplesApp
|
||||
notifications={notifications}
|
||||
navigation={navigation}
|
||||
data={data}
|
||||
http={http}
|
||||
unifiedSearch={unifiedSearch}
|
||||
/>
|
||||
</Route>
|
||||
<Route path={LINKS[1].path}>
|
||||
<SqlSearchExampleApp notifications={notifications} data={data} />
|
||||
</Route>
|
||||
<Route path={LINKS[2].path}>
|
||||
<SearchSessionsExampleApp
|
||||
navigation={navigation}
|
||||
notifications={notifications}
|
||||
data={data}
|
||||
unifiedSearch={unifiedSearch}
|
||||
/>
|
||||
</Route>
|
||||
<CompatRouter>
|
||||
<Route path={LINKS[0].path}>
|
||||
<SearchExamplesApp
|
||||
notifications={notifications}
|
||||
navigation={navigation}
|
||||
data={data}
|
||||
http={http}
|
||||
unifiedSearch={unifiedSearch}
|
||||
/>
|
||||
</Route>
|
||||
<Route path={LINKS[1].path}>
|
||||
<SqlSearchExampleApp notifications={notifications} data={data} />
|
||||
</Route>
|
||||
<Route path={LINKS[2].path}>
|
||||
<SearchSessionsExampleApp
|
||||
navigation={navigation}
|
||||
notifications={notifications}
|
||||
data={data}
|
||||
unifiedSearch={unifiedSearch}
|
||||
/>
|
||||
</Route>
|
||||
|
||||
<Route path="/" exact={true}>
|
||||
<Redirect to={LINKS[0].path} />
|
||||
</Route>
|
||||
<Route path="/" exact={true}>
|
||||
<Redirect to={LINKS[0].path} />
|
||||
</Route>
|
||||
</CompatRouter>
|
||||
</Router>
|
||||
</SearchExamplePage>
|
||||
</RedirectAppLinks>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue