asyncapi-react: React component does not work when exported from node_modules/@asyncapi/web-component/lib/asyncapi-web-component.js
Description I am trying to use react component in my nodeJs (ejs) application.
<script src="<%= rootPath %>/vendors/asyncapi/web-component/lib/asyncapi-web-component.js"></script>
<script src="https://unpkg.com/react@17/umd/react.production.min.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" crossorigin></script>
ReactDOM.render(
React.createElement(AsyncApiWebComponent, {
schema,
}
),
document.getElementById('swagger-ui')
);
Am I missing something? I am mostly back-end developer and do not have much experience with react. Any suggestions would be appreciated.
Thank you so much
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (7 by maintainers)
I am extremely glad that
schemaUrl
is in demand among people. 😁@magicmatatjahu thank you so much.
schemaUrl
works like a charm with"@asyncapi/web-component": "^0.19.0"
Thanks again @derberg @magicmatatjahu and have a great weekend 😃@magicmatatjahu thank you. I tried your code yeterday with no luck. I found a better solution using
schema.url
The below code works fine for me, however when I triedschemaUrl
it was ignored. The problem related with empty url was related that code was executed before url was specified. (defer
attribute)@rols2015 great!
schemaUrl
is added today in this commit https://github.com/asyncapi/asyncapi-react/commit/aa0a6da813dc45d0d8c400d104895b7c3a5e3040 If you could, tryschemaUrl
with version 0.19.0 of our component 😃EDIT: I see your previous comments, sorry 😄