编译脚本时
/// <reference path="./typings/react/react.d.ts" />
import React = __React;
var content = <div>Hello, world!</div>;
React.render(content, document.getElementById('output'));
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
$ tsc --jsx react app.tsx
app.tsx(6,7): error TS2339: Property 'render' does not exist on type 'typeof __React'.
有没有办法解决它?谢谢
我有一个前端应用程序,它连接到 websocket 并尝试提供 json-rpc2 从服务器调用客户端。*rpc.Client在使用“github.com/gorilla/websocket”用 Go 编写的服务器应用程序中创建它的最佳方法是什么?我尝试使用UnderlyingConn(): *websocket.Conn,jsonrpc2.NewClient(conn.UnderlyingConn())但它不起作用。