1

I've been tasked with implementing Papaya viewer in a React frontend, and it's my first time working with it. It might sound silly, but I can't figure out how to import it and get it to run in React.

I've installed it from NPM (NPM Link) and tried to implement it using the examples provided, but nothing renders on screen . In the console, I can see the following error:

Uncaught ReferenceError: PAPAYA_MANGO_INSTALLED is not defined at main.js:1553:1

This is my React component:

import Papaya from "papaya-viewer";
import "../../components/papaya/papaya.css";

const QC = () => {
const params = [];
params["worldSpace"] = true;
params["images"] = ["./sub-OAS30007_ses-d1641_run-01_T1w.nii.gz"];
params["surfaces"] = [];



    return (
        <div className={"papaya"} data-params={"params"}>
        </div>
    )
}

export default QC;

Has anybody successfully implemented it in React and can share some starter code? Many thanks.

  • 1
    This thread (https://github.com/rii-mango/Papaya/issues/90) and especially this may help: https://github.com/arindas/papaya-react – martinez314 Oct 25 '22 at 02:40

0 Answers0