@oneschema/react v0.5.3
A tool for embedding OneSchema into your application with React. This library contains a React component which will allow you to add an iframe to your application which can open OneSchema and import data into your application.
Getting Started
Installation
You can install this package with npm:
npm i --save @oneschema/react
Sample usage
import React, { useState } from "react"
import OneSchemaImporter from "@oneschema/react"
function OneSchemaExample() {
const [isOpen, setIsOpen] = useState(false)
const handleData = (data) => {
console.log(data)
}
return (
<div>
<button onClick={() => setIsOpen(true)}>Import</button>
<OneSchemaImporter
/* managing state from your application */
isOpen={isOpen}
onRequestClose={() => setIsOpen(false)}
/* required config values */
clientId={clientId}
userJwt={token}
templateKey={templateKey}
/* optional config values */
importConfig={{ type: "local", metadataOnly: false, }}
devMode={process.env.NODE_ENV !== "production"}
className="oneschema-importer"
style={{
position: "fixed",
top: 0,
left: 0,
width: "100vw",
height: "100vh",
}}
inline={false}
/* handling results */
onSuccess={handleData}
onCancel={() => console.log("cancelled")}
onError={(error) => console.log(error)}
/>
</div>
)
}
Documentation
Please see 📚 OneSchema's documentation for 📒 API reference and other helpful guides.
2 months ago
3 months ago
4 months ago
5 months ago
6 months ago
7 months ago
10 months ago
6 months ago
6 months ago
7 months ago
8 months ago
7 months ago
7 months ago
10 months ago
10 months ago
9 months ago
9 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago