|
|
细心的手术刀 · ConstraintLayout里的Tabl ...· 1 年前 · |
|
|
坚强的柿子 · mysql遍历查询结果,并操作 - 远启 ...· 2 年前 · |
|
|
飘逸的饭卡 · GitHub中开启二次验证Two-facto ...· 3 年前 · |
我正在使用typescript编写redux应用程序。
var item = React.createClass({
render: function() {
return (hello world)
export default class ItemList extends Component {
render() {
return ()
}
然后typescript会抱怨:
Property 'item' does not exist on type 'JSX.IntrinsicElements'.
组件必须以大写字母开头
而不是小写字母
否则TypeScript会大喊大叫的。改变
至
应该解决这个问题:
var Item = React.createClass({
render: function() {
return (hello world)
export default class ItemList extends Component {
render() {
return ()
}
您可以像这样声明您的自定义元素类型:
import * as React from 'react'
declare global {
namespace JSX {
interface IntrinsicElements {
item: React.DetailedHTMLProps, HTMLElement>;
}
|
|
坚强的柿子 · mysql遍历查询结果,并操作 - 远启 - 博客园 2 年前 |