Skip to content

Commit 3c6d2c5

Browse files
committed
fix: update react to 18 and react-tabs to 6
1 parent 50c7f60 commit 3c6d2c5

File tree

16 files changed

+2009
-991
lines changed

16 files changed

+2009
-991
lines changed

demo/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { render } from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import styled from 'styled-components';
44
import { RedocStandalone } from '../src';
55
import ComboBox from './ComboBox';
@@ -179,7 +179,9 @@ const Logo = styled.img`
179179
}
180180
`;
181181

182-
render(<DemoApp />, document.getElementById('container'));
182+
const container = document.getElementById('container');
183+
const root = createRoot(container!);
184+
root.render(<DemoApp />);
183185

184186
/* ====== Helpers ====== */
185187
function updateQueryStringParameter(uri, key, value) {

demo/playground/hmr-playground.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { render } from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import type { RedocRawOptions } from '../../src/services/RedocNormalizedOptions';
44
import RedocStandalone from './hot';
55

@@ -9,8 +9,10 @@ const swagger = window.location.search.indexOf('swagger') > -1;
99
const userUrl = window.location.search.match(/url=(.*)$/);
1010

1111
const specUrl =
12-
(userUrl && userUrl[1]) || (swagger ? 'museum.yaml' : big ? 'big-openapi.json' : 'museum.yaml');
12+
(userUrl && userUrl[1]) || (swagger ? 'openapi.yaml' : big ? 'big-openapi.json' : 'openapi.yaml');
1313

1414
const options: RedocRawOptions = { nativeScrollbars: false, maxDisplayedEnumValues: 3 };
1515

16-
render(<RedocStandalone specUrl={specUrl} options={options} />, document.getElementById('example'));
16+
const container = document.getElementById('example');
17+
const root = createRoot(container!);
18+
root.render(<RedocStandalone specUrl={specUrl} options={options} />);

demo/webpack.config.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function root(filename) {
1414
return resolve(__dirname + '/' + filename);
1515
}
1616

17-
export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) => ({
17+
export default (env: { playground?: boolean; bench?: boolean } = {}) => ({
1818
entry: [
1919
root('../src/polyfills.ts'),
2020
root(
@@ -51,12 +51,6 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
5151
fs: false,
5252
os: false,
5353
},
54-
alias:
55-
mode !== 'production'
56-
? {
57-
'react-dom': '@hot-loader/react-dom',
58-
}
59-
: {},
6054
},
6155

6256
performance: false,

0 commit comments

Comments
 (0)