Migrate to v0.5.x
If previously using a script tag to import OneSchema, please update the url as follows:
<script src="https://d3ah8o189k1llu.cloudfront.net/oneschema-importer-0.5.latest.min.js"></script>
In version >= 0.5, error payloads are Objects, rather than strings.
If you are using the Javascript importer, you will need to update the code that listens to the "error" event:
// Before
importer.on("error", (message) => {
console.log(message)
})
// After
importer.on("error", (error) => {
console.log(error.message)
})
If you are using the React importer, you will need to update the onError
callback that's passed in:
// Before
<OneSchemaImporter
...
onError={(message) => console.log(message)}
/>
// After
<OneSchemaImporter
...
onError={(error) => console.log(error.message)}
/>
Updated 10 months ago