Widget React Plugin
Last updated
npm install nexxplay-reactimport {NexxWidget} from "nexxplay-react";
export default function TestWidget{
return (
<div style={{width:"640px",height:"320px"}}>
<NexxWidget domain="999" widgetHash="ABCDEFG" params="{{launchMode:'none'}}" />
</div>
);
}import {useRef,useEffect} from 'react';
import {NexxWidget} from "nexxplay-react";
class test extends React.Component{
const widget=useRef(null);
useEffect(() => {
if(widget.current){
widget.current.setEventListener(onEvent);
}
}, []);
function onEvent(event){
console.log(event);
}
return (
<div style={{width:"640px",height:"320px"}}>
<NexXWidget domain="999" widgetHash="ABCDEFG" secret="ABCABCABC"
ref={widget}
/>
</div>
);
}