Choosing the Type at Runtime
【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的更多相关文章
- Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'
[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...
- Resource Path Location Type Target runtime Apache Tomcat v6.0 is not defined(项目报错)已解决
我换了开发工具后,导入的项目不是这里报错就是那里不错.不过,我喜欢.在tomcat里面部署项目后,定位到报错行时,总是提示我这句话:Description Resource Path Location ...
- "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. ...
- Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib 的一种情形
没有引用任何.net 4.5的东西,也没有引用 Newtonsoft.dll,原因是引用了微软的tlb类型库,引用方法如 https://www.cnblogs.com/nanfei/p/108798 ...
- JavaScript 和 React,React用了大量语法糖,让JS编写更方便。
https://reactjs.org/docs/higher-order-components.htmlhttps://codepen.io/gaearon/pen/WooRWa?editors=0 ...
- props & children
一. choosing the type at runtime import React from 'react'; import { PhotoStory, VideoStory } from '. ...
- Run-time type information--RTTI
In computer programming, run-time type information or run-time type identification (RTTI)[1] refers ...
- linux驱动程序之电源管理之Run-time PM 详解(4)
Run-time PM. 每个device或者bus都会向run-time PM core注册3个callback struct dev_pm_ops { ... int (*runtime_su ...
- 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 ...
随机推荐
- Java实现图像对比类
package com.function; import java.awt.image.BufferedImage; import java.io.BufferedWriter; import jav ...
- [UGUI]图文混排(三):资源管理
1.图文混排中的资源,主要是图片. 2.所谓的资源管理,可以分为资源对象池和资源加载这两部分.这里是为图文混排单独做一套资源管理,当然也可以改为调用项目中的资源管理. RichTextResource ...
- 49.纯 CSS 创作一支诱人的冰棍
原文地址:https://segmentfault.com/a/1190000015257561 感想:重点在让色彩滚动起来->background-position: 0 1000vh; HT ...
- 转:ArcGIS中利用ArcMap将地理坐标系转换成投影坐标系(从WKID=4326到WKID=102100)
对于非地理专业的开发人员,对与这些生涩的概念,我们不一定都要了解,但是我们要理解,凡是以经纬度为单位的都是地理坐标系,因为它归根结底是一个椭球体,只不过各个国家为了反映该国家所在区域地球的真实形状,而 ...
- 开发升级-微信小程序(感谢黄秀杰老师)
借助老师的博客 初次认识到了小程序开发的便捷,同时也深刻的感受到了,时代在不断地进步,编译将更加平民化,每一个人都将可以动手创造一款不错的软件 在黄秀杰老师的模板下,同时进行了修改,也在老师的模板下, ...
- 37. sqlplus工具连接服务端或其他电脑的oracle方式
1. 方式1:IP:监听端口/实例ID,例如:192.168.0.1:1521/orcl 2.方式2:IP:监听端口/服务名,例如:192.168.0.1:1521/ORCL.168.0.1 查看服务 ...
- node-disconf-client基本配置
node-disconf-client 需要cppm install node-disconf-client var disconf = require (' node-disconf-clien ...
- localStorage本地存储的用法
localStorage用法 if(window.localStorage){ alert('这个浏览器支持本地存储'); }else{ alert('这个浏览器支持不本地存储'); } localS ...
- es6初级之解构----之一
1. 访问对象属性 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- Tesseract-OCR4.0版本在VS2015上的编译与运行(转)
最近刚开始接触识别库引擎方面的知识,由于项目中需要使用光学识别处理模块,在老师与朋友的推荐下,我开始接触tesseract光学识别库,在最开始从GitHub上下载的源代码进行编译的时候,出现了许多意想 ...