-
-
Notifications
You must be signed in to change notification settings - Fork 192
Usage with React
Severin Ibarluzea edited this page Mar 28, 2020
·
3 revisions
First, install the universal-data-tool to your react project.
npm install universal-data-tool
import React from "react"
import UniversalDataViewer from "universal-data-tool/components/UniversalDataViewer"
export default () => (
<UniversalDataViewer
hideHeader // optional default: false (show header)
// oha is where you put your UDT formatted object
// Read more about this format here:
// https://github.com/UniversalDataTool/udt-format
oha={{
interface: { type: "..." },
taskData: [/* ... */],
// ...
}}
// when data is saved this is called
onSaveTaskOutputItem={(dataIndex, response) => {
// do something
}}
/>
)