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 ...
随机推荐
- android 开发 实现一个activity变成dialog对话框
效果图: 首先说说为什么需要大费周章的去用activity实现一个dialog,明明android系统已经提供了一个更方便的dialog了.原因如下: 1.activity模式的dialog可以实现更 ...
- python学习笔记_week18
note 1.JS 正则 test - 判断字符串是否符合规定的正则 rep = /\d+/; rep.test("asdfoiklfasdf89asdfasdf") # true ...
- 4. mysql 1449 : The user specified as a definer ('test'@'%') does not exist 解决方法
权限问题,授权 给 root 所有sql 权限 mysql> grant all privileges on *.* to test@"%" identified by & ...
- tensorflow实战系列(一)
最近开始整理一下tensorflow,准备出一个tensorflow实战系列,以飨读者. 学习一个深度学习框架,一般遵循这样的思路:数据如何读取,如如何从图片和标签数据中读出成tensorflow可以 ...
- opencv-3.3安装记录-ubuntu 14.04
这个二逼问题不会是最后一次. ipcv-****.tar.gz 这个文件在cmake的时候会卡住,这里先下载这个文件,大概38M,放到.cache/ippcv目录下就可以了.貌似还需要改下名字. 就可 ...
- css-选择器性能
ID选择器 比如#header 类选择器 比如.promo 元素选择器 比如 div 兄弟选择器 比如 h2 + p 子选择器 比如 li > ul 后代选择器 比如 ul a 7. 通用选择器 ...
- java由字符型强制转化为整型例题
此Java程序依次输出参数,参数类型为字符型,要求更改程序,使得字符型强制转化为整形,并将这些整数相加,最后输出总和. 原程序: package demo; public class CommandP ...
- React之使用Context跨组件树传递数据
--------------------------------- 讲解一 原文:https://blog.csdn.net/xuxiaoping1989/article/details/78480 ...
- [PHP]PHP定时任务的实现
---------------------------------------------------------------------------------------------------- ...
- SQL Server 优化---为什么索引视图(物化视图)需要with(noexpand)强制查询提示
本文出处:http://www.cnblogs.com/wy123/p/6694933.html 第一次通过索引视图优化SQL语句,以及遇到的一些问题,记录一下. 语句分析 最近开发递交过来一个查询统 ...