Open yulyasystem opened 2 years ago
We are also facing the issue when we tried to run swagger-editor in react application on 17.0.2
Below is the error we got
Need this tooo.
We are also facing the issue when we tried to run swagger-editor in react application on 17.0.2
Below is the error we got
this may solved the problem if you really need to integrate swagger-editor in your app. In the swagger editor github index.html use swaggerEditorBundle instead of SwaggerEditor
It will look like this.
import React from 'react';
import SwaggerEditorBundle from 'swagger-editor-dist/swagger-editor-bundle';
import SwaggerEditorStandalonePreset from 'swagger-editor-dist/swagger-editor-standalone-preset'
import 'swagger-editor-dist/swagger-editor.css';
class App extends React.Component {
componentDidMount(){
window.onload = function() {
// Build a system
const editor = SwaggerEditorBundle({
dom_id: '#swagger-editor',
layout: 'StandaloneLayout',
presets: [
SwaggerEditorStandalonePreset
],
queryConfigEnabled: false,
})
window.editor = editor
}
}
render() {
return <div id='swagger-editor'></div>
}
}
export default App;
https://github.com/swagger-api/swagger-editor/issues/1236#issuecomment-294678339
window.localStorage.getItem('swagger-editor-content') swaggerComponent.specSelectors.specStr()
With angular: https://stackoverflow.com/a/57431950/9442224
Content & configuration
I'm struggling to integrate swagger-editor into React application with "react": "17.0.2", "react-dom": "17.0.2"
How can we help?
I try to import SwaggerEditor to integrate it into my React app.
Instead I receive issue
After disabling typescript the issue with ace-editor appears:
Do you have any plans to make React component for swagger editor or any suggestions/ideas for my problem? How can I connect swagger-editor to react 17.0.2?