Skip to content

Commit

Permalink
fix: update react to 18 and react-tabs to 6
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed Jun 5, 2024
1 parent 50c7f60 commit 3c6d2c5
Show file tree
Hide file tree
Showing 16 changed files with 2,009 additions and 991 deletions.
6 changes: 4 additions & 2 deletions demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import styled from 'styled-components';
import { RedocStandalone } from '../src';
import ComboBox from './ComboBox';
Expand Down Expand Up @@ -179,7 +179,9 @@ const Logo = styled.img`
}
`;

render(<DemoApp />, document.getElementById('container'));
const container = document.getElementById('container');
const root = createRoot(container!);
root.render(<DemoApp />);

/* ====== Helpers ====== */
function updateQueryStringParameter(uri, key, value) {
Expand Down
8 changes: 5 additions & 3 deletions demo/playground/hmr-playground.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import type { RedocRawOptions } from '../../src/services/RedocNormalizedOptions';
import RedocStandalone from './hot';

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

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

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

render(<RedocStandalone specUrl={specUrl} options={options} />, document.getElementById('example'));
const container = document.getElementById('example');
const root = createRoot(container!);
root.render(<RedocStandalone specUrl={specUrl} options={options} />);
8 changes: 1 addition & 7 deletions demo/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function root(filename) {
return resolve(__dirname + '/' + filename);
}

export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) => ({
export default (env: { playground?: boolean; bench?: boolean } = {}) => ({
entry: [
root('../src/polyfills.ts'),
root(
Expand Down Expand Up @@ -51,12 +51,6 @@ export default (env: { playground?: boolean; bench?: boolean } = {}, { mode }) =
fs: false,
os: false,
},
alias:
mode !== 'production'
? {
'react-dom': '@hot-loader/react-dom',
}
: {},
},

performance: false,
Expand Down
Loading

0 comments on commit 3c6d2c5

Please sign in to comment.