|
|
踢足球的饺子 · Dependency injection ...· 1 年前 · |
|
|
耍酷的骆驼 · python解析JSON数据-阿里云开发者社区· 2 年前 · |
|
|
狂野的啄木鸟 · springboot集成kafka消费者序列 ...· 2 年前 · |
|
|
谦逊的跑步机 · CMS晋升失败解决方案之偏方 - 简书· 2 年前 · |
|
|
沉稳的生姜 · Node 进阶:express ...· 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>;
}
|
|
耍酷的骆驼 · python解析JSON数据-阿里云开发者社区 2 年前 |
|
|
狂野的啄木鸟 · springboot集成kafka消费者序列化问题报错*is not an instance of org.apache.kafka.common.serialization.Deserializer_class org.apache.kafka.common 2 年前 |
|
|
谦逊的跑步机 · CMS晋升失败解决方案之偏方 - 简书 2 年前 |