React在Java、Eclipse中使用

https://blog.csdn.net/zhgl7688/article/details/72875021

React在Java、Eclipse中使用

eclispe默认是不能使用jsx文件.;

1、安装React插件

目录Help--》eclipsemarketplace--》在Find中输入react搜索--》安装如下插件,安装插件后eclipse会自动重启,


2、页面引用react

[html]  view plain  copy
  1. <script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>  
  2.     <script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>  
  3.     <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>  

3、创建jsx文件

[html]  view plain  copy
  1. ReactDOM.render(  
  2.   <h1>Hello, world!</h1>,  
  3.   document.getElementById('example')  
  4. );  

4、创建jsp文件,加入

[html]  view plain  copy
  1. <body>  
  2.   <div id="example"></div>  
  3. <script type="text/babel" src="helloworld_react.jsx"></script>  
  4. </body  

5、react其他用法同理


出现不能正常使用的原因:http://blog.csdn.net/zhgl7688/article/details/72876020


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值