![]() |
狂野的火车 · java比较两个对象的内容 - CSDN文库· 10 月前 · |
![]() |
私奔的卤蛋 · 获取共享Outlook日历事件C#-腾讯云开 ...· 11 月前 · |
![]() |
爱看书的竹笋 · 单层LSTM和双层LSTM有什么区别 - ...· 11 月前 · |
![]() |
光明磊落的蚂蚁 · docker/k8s常见错误处理 - ...· 1 年前 · |
![]() |
性感的香槟 · 【Python开发手册】JWT ...· 1 年前 · |
我正在使用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>;
}
![]() |
狂野的火车 · java比较两个对象的内容 - CSDN文库 10 月前 |
![]() |
私奔的卤蛋 · 获取共享Outlook日历事件C#-腾讯云开发者社区-腾讯云 11 月前 |
![]() |
爱看书的竹笋 · 单层LSTM和双层LSTM有什么区别 - CSDN文库 11 月前 |