![]() |
宽容的黑框眼镜 · CompletableFuture ...· 1 年前 · |
![]() |
温柔的豆浆 · 在线python ...· 1 年前 · |
![]() |
卖萌的鸡蛋面 · lua随机函数-math.random - 简书· 2 年前 · |
![]() |
重感情的脸盆 · gitee怎么合并分支 - 知乎· 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>;
}
![]() |
宽容的黑框眼镜 · CompletableFuture future.get 遇到 java.util.concurrent.TimeoutException_future多线程调用方法报空指针_master-dragon的博客-CSDN博客 1 年前 |
![]() |
卖萌的鸡蛋面 · lua随机函数-math.random - 简书 2 年前 |
![]() |
重感情的脸盆 · gitee怎么合并分支 - 知乎 2 年前 |