Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在react中使用自定义html元素_Reactjs_Typescript_Observable_Htmlelements - Fatal编程技术网

Reactjs 在react中使用自定义html元素

Reactjs 在react中使用自定义html元素,reactjs,typescript,observable,htmlelements,Reactjs,Typescript,Observable,Htmlelements,我正在使用Typescript和REACT,我想在我的TSX中利用和包装一些自定义html元素。例如,我正在使用一个库,其中包含一个名为ch5 button的客户html元素,它在一个普通html文件中使用 <ch5-button class="shadow-pulse-button" type="default" shape="circle" label="" iconClass="fas fa-award"> </ch5-button>

我正在使用Typescript和REACT,我想在我的TSX中利用和包装一些自定义html元素。例如,我正在使用一个库,其中包含一个名为ch5 button的客户html元素,它在一个普通html文件中使用

        <ch5-button class="shadow-pulse-button" type="default" shape="circle" label="" iconClass="fas fa-award">
        </ch5-button>
console.log显示
soI我不知道我是否在正确的轨道上使用这个东西。ch5Button是一个类,它有很多方法,看起来很像html元素,但我不知道如何使用它,以及如何学习使用它的方法。我找到了一些网站,解释了如何使用可观察物等,但我对我是否走上了正确的道路略知一二。我附上了一些图片,如果ch5Button的属性和方法在chrome调试器中看起来像什么

谁能给我指出正确的方向吗?我将创建一个REACT组件来包装这个类,并可以使用道具来设置正确的属性等

我很乐意构建REACT应用程序,但不可否认,我还不是一个高级的应用程序开发人员,但我会尽全力学习

declare var CrComLib: typeof import('@crestron/ch5-crcomlib');
...
    const ch5Button = new CrComLib.Ch5Button();
    console.log("ch5Button");
    console.log(ch5Button);