@hisp-amr/org-unit-tree
v0.0.17
Published
DHIS2 single select organisation unit tree
Downloads
7
Readme
org-unit-tree
Installation
yarn add @hisp-amr/org-unit-tree
# or
npm i @hisp-amr/org-unit-tree
Usage
REACT_APP_DHIS2_BASE_URL
needs to be set.
# [root_dir]/.env.development
REACT_APP_DHIS2_BASE_URL=https://amrtest.icmr.org.in/amr
# [root_dir]/.env.production
REACT_APP_DHIS2_BASE_URL=../../..
import React from 'react'
import { OrgUnitTree } from '@hisp-amr/org-unit-tree'
const onError = error => console.error(error)
const onSelect = selected => console.log(selected)
const App = () => (
<>
{/* Other components */}
<OrgUnitTree
onSelect={onSelect}
onError={onError}
/>
</>
)