Skip to content

Commit c664dd0

Browse files
authored
fix: update react to 18 and react-tabs to 6 (#2547)
1 parent 72dd57d commit c664dd0

16 files changed

+1986
-1105
lines changed

demo/index.tsx

+4-2
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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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';
4-
import RedocStandalone from './hot';
4+
import { RedocStandalone } from '../../src';
55

66
const big = window.location.search.indexOf('big') > -1;
77
const swagger = window.location.search.indexOf('swagger') > -1;
@@ -13,4 +13,6 @@ const specUrl =
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/playground/hot.tsx

-10
This file was deleted.

demo/webpack.config.ts

+1-7
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)