mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
fix: A couple minor bug fixes (#436)
* Fix so deref always returns an object. * Fix SelectOnClick so it does not crash * chore: fix demo's webpack.config.ts * Fix space
This commit is contained in:
parent
390f6c1324
commit
5dc21af281
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
|||
import { render } from 'react-dom';
|
||||
import styled from 'styled-components';
|
||||
import { resolve as urlResolve } from 'url';
|
||||
import { RedocStandalone } from '../';
|
||||
import { RedocStandalone } from '../src';
|
||||
import ComboBox from './ComboBox';
|
||||
|
||||
const demos = [
|
||||
|
|
|
@ -28,6 +28,10 @@ export default {
|
|||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||
},
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -56,6 +60,17 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /node_modules\/(swagger2openapi|reftools)\/.*\.js$/,
|
||||
use: {
|
||||
loader: 'awesome-typescript-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
allowJs: true,
|
||||
instance: 'ts2js-transpiler-only',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
|
|
|
@ -5,7 +5,7 @@ import { ClipboardService } from '../../services';
|
|||
export class SelectOnClick extends React.PureComponent {
|
||||
private child: HTMLDivElement | null;
|
||||
handleClick = () => {
|
||||
ClipboardService.selectElement(this.refs.child);
|
||||
ClipboardService.selectElement(this.child);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
@ -105,7 +105,7 @@ export class OpenAPIParser {
|
|||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
return res;
|
||||
return res || {};
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user