Using a component written by native JS, depending on zrender.js and D3.js, how to use this component in a react project

background:
there is a need to implement a tree view that can be expanded up and down. Due to the limited ability, the master can only write traditional JS,. He encapsulated it with traditional JS, and the directory is as follows:

d3.jszrender.js,reactreactzrenderzrender<script>

then copy the amtree object in amtree.js to the tools.js of react.
question:
now I still report zrender is not defined in the tools.js file. Do I still need import zrender, in this file, but the zrender, installed using npm is not the same as the native one? what should I do?

Jun.29,2021
Change the zrender in

tools.sjs to window.zrender (assuming your object's missing name is zrender)


const zrender = require ("lib/zrender.js")

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3af89-4eebe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3af89-4eebe.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?