React component for listing LHC form from GitLab
Create .npmrc file in the project root and add the following GitHub package registry code in the file.
@medigy:registry=https://npm.pkg.github.comThen, Install from the command line:
npm install @medigy/ux-react-lhc-formOR
Install via package.json:
"@medigy/ux-react-lhc-form": "^1.0.1"Import the following library and styles in your page
import * as LHCForm from '@medigy/ux-react-lhc-form';
import '@medigy/ux-react-lhc-form/dist/index.css';Declare a variable in your component like the following
const lhcFormRef: React.RefObject<LHCForm.LHCFormComponent> = React.createRef();Then include the component in your render method like the following
<LHCForm.LHCFormComponent
ref={lhcFormRef}
LHCFormPath={apiURL}
accessToken={accessToken}
/>Props Configuration
| Key | Value | Type |
|---|---|---|
| LHCFormPath | GitLab API URL for the LHC Form | String |
| accessToken | GitLab personal access token | String |
const formData:| Array<LHCForm.ILHCFormData>| undefined = lhcFormRef.current?.getLHCFormData();