replacer-react-component
v2.0.1
Published
A package for index.html DOM-objects replacement by React components
Downloads
1
Readme
replacer-react-component
Overview
React components for replacer-API interaction. Works with backend API - replacer-reactor.
Usage
specUrl - path to replacer-reactor spec-file
import { OpenApiSwagger, LiveFeed } from 'replacer-react-component'
window.localStorage.setItem('token', 'test')
const specUrl = 'http://localhost:8008/spec/swagger.json'
const swg = new OpenApiSwagger(specUrl)
swg.connect((client, err) => {
if (err) {
ReactDOM.render(
<div className='std-win'>no spec - <a href={specUrl}>{specUrl}</a> !</div>,
document.getElementById('root')
)
}
else {
ReactDOM.render(
<div>
<LiveFeed swgClient={client} headerTxt='LiveFeed component' />
</div>,
document.getElementById('root')
)
}
})
Dependencies
- swagger-js: for backend API replacer-reactor in OpenAPI-Spec format