首页 \ 问答 \ Typescript React React.createElement:类型不应该为null,undefined,boolean或number(Typescript React React.createElement: type should not be null, undefined, boolean, or number)

Typescript React React.createElement:类型不应该为null,undefined,boolean或number(Typescript React React.createElement: type should not be null, undefined, boolean, or number)

我正在使用TypeScript(1.8.10)并学习反应。 我正在使用React-Bootstrap来构建一个简单的导航作为示例,并且出现以下错误。 这个错误阻止了dom被渲染。 我是全新的反应,所以不知道我在这里做错了什么。 非常感谢您提供任何帮助或指针来解决此错误。

    // A '.tsx' file enables JSX support in the TypeScript compiler, 
// for more information see the following page on the TypeScript wiki:
// https://github.com/Microsoft/TypeScript/wiki/JSX
/// <reference path="./../../../typings/index.d.ts" />

import * as React from 'react';
import * as ReactBootstrap from 'react-bootstrap';
interface INavigationProps {
}

let Navbar = ReactBootstrap.Navbar;
let NavItem = ReactBootstrap.NavItem;
let MenuItem = ReactBootstrap.MenuItem;
let NavbarHeader = ReactBootstrap.NavbarHeader;
const dropdownItems = [
    { href: '#', name: 'Overview' },
    { href: '#', name: 'Setup' },
    { href: '#', name: 'Usage' },
];


export default class Navigation extends React.Component<INavigationProps, {}> {
    render() {

        return (
            <Navbar>
                <NavbarHeader href="homepage.html" name="Website Name"/>
                <NavItem>
                    <MenuItem link="about.html" title="About" />
                    <MenuItem link="contact.html" title="Contact" />
                    <MenuItem link="services.html" title="Services" />
                </NavItem>
            </Navbar>
        );
    }
}

    // A '.tsx' file enables JSX support in the TypeScript compiler, 
// for more information see the following page on the TypeScript wiki:
// https://github.com/Microsoft/TypeScript/wiki/JSX
/// <reference path="./../../typings/index.d.ts" />

import * as React from "react";
import * as ReactDOM from "react-dom";
import * as ReactBootstrap from 'react-bootstrap';

import HeaderNavigation from "./NavigationComponent/navigation";
import Hello from "./HelloComponent/Hello";

ReactDOM.render(
    <div>
        <HeaderNavigation />
        <Hello name="Athraya" />
   </div>,
    document.getElementById("root")
);

错误


I am using TypeScript(1.8.10) and learning react. I am using React-Bootstrap to build a simple navigation as an example and I am getting the following error. THe error prevents the dom from getting rendered. I am totally new to react so not sure what I am doing wrong here. Thank you so much for any help or pointers to get past this error.

    // A '.tsx' file enables JSX support in the TypeScript compiler, 
// for more information see the following page on the TypeScript wiki:
// https://github.com/Microsoft/TypeScript/wiki/JSX
/// <reference path="./../../../typings/index.d.ts" />

import * as React from 'react';
import * as ReactBootstrap from 'react-bootstrap';
interface INavigationProps {
}

let Navbar = ReactBootstrap.Navbar;
let NavItem = ReactBootstrap.NavItem;
let MenuItem = ReactBootstrap.MenuItem;
let NavbarHeader = ReactBootstrap.NavbarHeader;
const dropdownItems = [
    { href: '#', name: 'Overview' },
    { href: '#', name: 'Setup' },
    { href: '#', name: 'Usage' },
];


export default class Navigation extends React.Component<INavigationProps, {}> {
    render() {

        return (
            <Navbar>
                <NavbarHeader href="homepage.html" name="Website Name"/>
                <NavItem>
                    <MenuItem link="about.html" title="About" />
                    <MenuItem link="contact.html" title="Contact" />
                    <MenuItem link="services.html" title="Services" />
                </NavItem>
            </Navbar>
        );
    }
}

    // A '.tsx' file enables JSX support in the TypeScript compiler, 
// for more information see the following page on the TypeScript wiki:
// https://github.com/Microsoft/TypeScript/wiki/JSX
/// <reference path="./../../typings/index.d.ts" />

import * as React from "react";
import * as ReactDOM from "react-dom";
import * as ReactBootstrap from 'react-bootstrap';

import HeaderNavigation from "./NavigationComponent/navigation";
import Hello from "./HelloComponent/Hello";

ReactDOM.render(
    <div>
        <HeaderNavigation />
        <Hello name="Athraya" />
   </div>,
    document.getElementById("root")
);

Error


原文:https://stackoverflow.com/questions/39461794
更新时间:2023-11-29 07:11

最满意答案

我和开发者社区一起在Twilio工作。

这听起来像你需要的是电话筛选 。 C#中也有一些例子。

希望这可以帮助。


I work at Twilio with the developer community.

It sounds like what you need here is Call Screening. There are also some examples there in C#.

Hope this helps.

相关问答

更多
  • Twilio开发人员在这里传播信息。 我想你可能在队列中有一些过于复杂的东西。 您实际上可以提供该信息并收集原始呼叫,而无需自行拨出电话,最终连接两个呼叫。 就是这样: 你的来电TwiML应该是这样的: ONWARD DIAL NUMBER 在连接两个呼叫 ...
  • [[编辑]] 唉唉! 我知道它是什么! 以下答案(我为子孙后代保留)是完全错误的。 当被拨打的人和耳语挂断时,将调用动词上的action 。 从文档中, DialCallStatus值可以是 :已完成,忙碌,无应答,失败或已取消。 当该人拿起电话时,状态不能为忙,无应答,失败或取消。 因此,当他们在耳语结束之前挂断电话时,呼叫状态将会完成。 因此,当您的操作被调用时, DialCallStatus将完成,您的voicemail.php将挂断。 您还会收到一个DialCallDuration ,这 ...
  • 通过拨打号码来访问语音邮件,为此,您必须以编程方式执行所有步骤。 可能你想看看谷歌语音邮件,我心里有他们自己的服务,提供语音邮件服务。 http://support.google.com/voice/bin/answer.py?hl=en&answer=115073 voicemail is accessed by dialing a number, to do this you have to all steps programatically. May be you want to look at Go ...
  • 不确定是否有其他问题,但有一个问题是:意图操作不是"android.intent.action.ACTION_NEW_VOICEMAIL"而是"android.intent.action.NEW_VOICEMAIL" 。 也许你把它与VoicemailContract类的常量名称混合起来,即VoicemailContract.ACTION_NEW_VOICEMAIL 。 Not sure that else is wrong, but one problem is: the intent action is ...
  • Twilio开发者传道者在这里。 我将通过向您的任务添加一个新的数组属性来记录拒绝该任务的工作人员的SID。 然后,当工作人员拒绝保留时,在该任务上添加该属性。 然后,您可以添加到目标表达式 : worker.sid NOT IN task.rejected_workers 一旦任务失败了该表达式,将其移动到具有一个空闲工作队而不是接受预留的新队列,只需将该呼叫重定向到某些TwiML以语音邮件。 如果这有帮助,请告诉我。 编辑 事实证明,这并不是实现这一目标的正确方法,即使目标工作者表达式 ...
  • 您可以使用数据库驱动的用户列表。 http://www.voip-info.org/wiki/view/Asterisk+voicemail+database 在数据库中,您可以使用视图和/或函数来创建虚拟用户列表。 You can use database-driven list of users. http://www.voip-info.org/wiki/view/Asterisk+voicemail+database In database you can use view and/or funct ...
  • 我和开发者社区一起在Twilio工作。 这听起来像你需要的是电话筛选 。 C#中也有一些例子。 希望这可以帮助。 I work at Twilio with the developer community. It sounds like what you need here is Call Screening. There are also some examples there in C#. Hope this helps.
  • 看看Tropo 。 它似乎有你描述的大部分功能,还有一些会让你感到沮丧 - 包括短信服务。 它也是免费的开发和廉价的生产。 我不为Tropo或附属公司工作,我只是听说过有关服务的好消息。 Take a look at Tropo. It seems to have much of the functionality you describe, and a few more which will tickle you pink - including SMS service. It's also free f ...
  • 根据[手册,您要查找的SEND_TO_VOICEMAIL字段不在ContactsContract.Data表中,而是在ContactsContract.Contacts表中。 看起来你正试图修改错误的表格。 有关每个表中的字段,请参阅ContactsContract.Data和ContactsContract.Contacts 。 According to the[manual, the SEND_TO_VOICEMAIL field you're looking for isn't in the Cont ...
  • 您可能无法直接从您的应用程序访问语音邮件,但有几个运营商提供直接电话号码,供人们直接拨入其语音邮件。 然后,您可以让人们在首选项中输入此语音邮件号码,并使用tel:1-408-555-5555访问它 有关此内容的更多信息,请参阅iOS参考库 You may not be able to directly access the voicemail from your app, but several operators provide a direct call number for people to di ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)