Reactjs library in Zul page

223 Views Asked by At

I'm a newbie in ReactJs and Zk Java framework. I have followed this instruction here (https://reactjs.org/docs/add-react-to-a-website.html) When I do it with html file, It seems nice, but It did not work with zul page in zk framework. My code is:

<zk>
...
<script type="text/javascript" src="/js/reactjs/react.development.js"></script>
<script type="text/javascript" src="/js/reactjs/react-dom.development.js"></script>
<script type="text/javascript">
      console.log(React.createElement);
</script>
</zk>

Errors: React is not defined Please help me ...

1

There are 1 best solutions below

0
Duy Nguyên On

Add this in zk tag

<zk xmlns:n="native" xmlns:x="xhtml" xmlns:zk="zk" xmlns:z="zul" xmlns:h="http://www.w3.org/1999/xhtml"></zk>

And use <n:script></n:script>