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 ...
随机推荐
- spring揭密学习笔记(3)-spring ioc容器:掌管大局的IoC Service Provider
1.IOC service Provider的概念.IoC Service Provider在这里是一个抽象出来的概念,它可以指代任何将IoC场景中的业务对象绑定到一起的实现方式.它可以是一段代码,也 ...
- PHP读取txt文件到数组
$file_path = "test.txt"; if(file_exists($file_path)){ $file_arr = file($file_path); for($i ...
- oracle PL/SQL的介绍
转自:http://blog.sina.com.cn/s/blog_4c302f060101i4o1.html 一 PL/SQL的介绍 1 PL/SQL是什么? PL/SQL(procedural l ...
- element 表格无法绑定服务返回数据
无法直接绑定返回的Object属性,需要用js做一次对象转换后,才能绑定 <template> <div> <!--<button>添加服务器</but ...
- css3-animate
常用动画设置: effect easing duration effect: <select name="effects" id="effectTypes&quo ...
- epoll_wait 时 POLLERR 与 POLLIN 同时返回的现象解析(转)
今天code review时,同事B对我代码中的poll()的处理做法提出了异议.于是做了些研究,还发现了一些好玩的故事. 异议的代码 我的代码是参考manpage写的,类似下面的做法.同事B说没有处 ...
- Java IO流学习总结五:转换流-InputStreamReader、OutputStreamWriter
类的继承关系 Reader |__ BufferedReader.StringReader.InputStreamReader |__ FileReader Writer |__ BufferedWr ...
- DOTWeen 使用
using UnityEngine; using System.Collections; using DG.Tweening; using UnityEngine.UI; public class T ...
- C++操作oracle数据库
数据库操作方式:可以采用ADO方式,也可以采用oracle本身提供的Proc*C/C++或者是OCCI方式操作数据库. 连接方式:可以是客户端连接.也可以是服务器端连接. 数据库配置:无论是何种连 ...
- English Pronunciation Analysis | Advanced English Conversation
English Pronunciation Analysis | Advanced English Conversation Share Tweet Share Tagged With: Ben Fr ...