We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
译文:https://jkchao.github.io/typescript-book-chinese/jsx/nonReactJSX.html#jsxfactory
有两个问题:
--jsxFactory
/** @jsx jsxFactory */ import { jsxFactory } from 'jsxFactory'; var div = <div>Hello JSX!</div>;
书中结果是:
'use strict'; var jsxFactory_1 = require('jsxFactory'); var div = jsxFactory_1.jsxFactory.createElement('div', null, 'Hello JSX!');
实际结果是(在 Typescript 3.8.3 编译器上运行),没有.createElement:
.createElement
"use strict"; /** @jsx jsxFactory */ var jsxFactory_1 = require("jsxFactory"); var div = jsxFactory_1.jsxFactory("div", null, "Hello JSX!");
重现链接: Playground Link
The text was updated successfully, but these errors were encountered:
谢谢,我稍后验证一下,没问题就加上。
Sorry, something went wrong.
我这边试了下,是正常的。
--jsxFactory 这个选项没有被废弃,https://www.typescriptlang.org/docs/handbook/compiler-options.html 。 建议直接在本地跑 tsc,Playgroud 上没有部分编译选项。 我这边试了下,是正常的。
本地 tsc 确实没有该选项,不过你发的这个文档链接确实有,可能是不推荐使用了吧
$ npx tsc --version Version 3.8.3 $ npx tsc --help | grep 'jsx' --jsx KIND
No branches or pull requests
译文:https://jkchao.github.io/typescript-book-chinese/jsx/nonReactJSX.html#jsxfactory
有两个问题:
--jsxFactory
选项 tsc 已废弃(找不到该选项了),建议将该小标题添加废弃标识或说明。书中结果是:
实际结果是(在 Typescript 3.8.3 编译器上运行),没有
.createElement
:重现链接:
Playground Link
The text was updated successfully, but these errors were encountered: