|
|
没人理的仙人球 · electron ...· 1 年前 · |
|
|
微醺的硬币 · View与ViewGroup layout ...· 1 年前 · |
|
|
宽容的莲藕 · !求解决办法:ERROR: Symbol ...· 1 年前 · |
|
|
踏实的紫菜汤 · 在VBA中,在筛选后,是否能全部删除筛选的除 ...· 2 年前 · |
|
|
有腹肌的黄花菜 · GitOps 工具 Argo CD ...· 2 年前 · |
我正在使用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>;
}