Choosing the Type at Runtime

  You cannot use a general expression as the React element type. If you do want to use a general expression to indicate the type of the element, just assign it to a capitalized variable first. This often comes up when you want to render a different component based on a prop:

  

  To fix this, we will assign the type to a capitalized variable first:

  

参考:https://facebook.github.io/react/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized

Choosing the Type at Runtime的更多相关文章

  1. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'

    [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...

  2. Resource Path Location Type Target runtime Apache Tomcat v6.0 is not defined(项目报错)已解决

    我换了开发工具后,导入的项目不是这里报错就是那里不错.不过,我喜欢.在tomcat里面部署项目后,定位到报错行时,总是提示我这句话:Description Resource Path Location ...

  3. "Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7

    1.错误背景 系统安装了.net framework4.0.4.5,项目先使用VS2013(4.5)开发,后来又重新用VS2010开发(4.0),运行时出现这个错误 2.错误原因 In .Net 4. ...

  4. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib 的一种情形

    没有引用任何.net 4.5的东西,也没有引用 Newtonsoft.dll,原因是引用了微软的tlb类型库,引用方法如 https://www.cnblogs.com/nanfei/p/108798 ...

  5. JavaScript 和 React,React用了大量语法糖,让JS编写更方便。

    https://reactjs.org/docs/higher-order-components.htmlhttps://codepen.io/gaearon/pen/WooRWa?editors=0 ...

  6. props & children

    一. choosing the type at runtime import React from 'react'; import { PhotoStory, VideoStory } from '. ...

  7. Run-time type information--RTTI

    In computer programming, run-time type information or run-time type identification (RTTI)[1] refers ...

  8. linux驱动程序之电源管理之Run-time PM 详解(4)

    Run-time PM. 每个device或者bus都会向run-time PM core注册3个callback   struct dev_pm_ops { ... int (*runtime_su ...

  9. Target runtime Apache Tomcat v6.0 is not defined. phyy Unknown Faceted Project Problem

    Description Resource Path Location TypeTarget runtime Apache Tomcat v6.0 is not defined. phyy Unknow ...

随机推荐

  1. nginx安装以及常用配置

    nginx的源码安装 0 安装相关软件:yum -y install pcre-devel zlib-devel openssl-devel 1 下载 nginx-1.14.0.tar.gz 2 安装 ...

  2. 获取get请求后面的参数

    var str = "www.baidu.com?id=1&name=zhangsan"; var data = str.split("?"); con ...

  3. python获取指定日期的前N天日期和后N天日期

    #encoding:utf-8from datetime import date, datetime, timedelta day = date.today()now = datetime.now() ...

  4. python tkinter chk

    视频过程中的练习, 可以在python2.7下运行. 001: hello,world: 1 2 3 4 5 6 from Tkinter import Label, Tk root = Tk() t ...

  5. 读O目标KR关键结果的一些个人理解

    O目标KR关键结果 为了完成一个目标,需要完成几个或者多个关键的结果来验证. 书的开头写的是一些理论,有印象的东西还是从汉娜和杰克的公司来说,卖茶叶的公司.联系着茶农和可以产生消费的餐馆和供应商,在未 ...

  6. 一些被提问频率最高的12个php面试题,以及对应的常规回答。

    一些被提问频率最高的12个php面试题,以及对应的常规回答.1.问题:请用最简单的语言告诉我php是什么?回答:php全称:hypertext preprocessor,是一种用来开发动态网站的服务器 ...

  7. vs2008发布项目失败的解决方法

    解决办法: 要知道发布是怎么失败的,用组合键"Ctrl+Alt+O"即可,仔细查看信息可发现有没发布成功的详细提示,然后在资源管理器中找到那一项,删除或排除到项目外,重新生成之后再 ...

  8. elcipse 安装lombok插件解决 @Slf4j 等找不到log变量问题

    参考:http://blog.51cto.com/4925054/2127840 <dependency> <groupId>org.projectlombok</gro ...

  9. USB之HID类Set_Report Request[调试手记1]

    请翻开<Device Class Definition for Human Interface Devices (HID) Version 1.11 >7.2.2 Set_Report R ...

  10. day19-高阶函数、匿名函数

    map 函数 map 是一个在 Python 里非常有用的高阶函数.它接受一个函数和一个序列(迭代器)作为输入,然后对序列(迭代器)的每一个值应用这个函数,返回一个序列(迭代器),其包含应用函数后的结 ...