ReactJS component names must begin with capital letters?!
来源:互联网 发布:安装ubuntu系统 编辑:程序博客网 时间:2024/05/21 00:16
http://stackoverflow.com/questions/30373343/reactjs-component-names-must-begin-with-capital-letters
I am playing around with the ReactJS framework on JSBin.
I have noticed that if my component name starts with a lowercase letter it does not work.
For instance the following does not render:
var fml = React.createClass({ render: function () { return <a href='google.com'>Go</a> }});React.render(<fml />, document.body);
But as soon as I replace the fml
with Fml
it does render.
Is there a reason I cannot begin tags with small letters?
Answer:
In JSX, lower-case tag names are considered to be HTML tags. However, lower-case tag names with a dot (property accessor) aren't.
See HTML tags vs React Components.
<component />
compiles toReact.createElement('component')
(html tag)<Component />
compiles toReact.createElement(Component)
<obj.component />
compiles toReact.createElement(obj.component)
0 0
- ReactJS component names must begin with capital letters?!
- query must begin with SELECT or FROM
- query must begin with SELECT or FROM: delete 错误解决方法
- 【Error】: rpm: arguments to --root (-r) must begin with a /
- query must begin with SELECT or FROM: delete
- the component of reactjs
- name can no longer contain capital letters
- org.apache.jasper.JasperException: /XXX/XXX.jsp(59,55) Attribute qualified names must be unique with
- Hibernate之update(2)——报错query must begin with SELECT or FROM
- The processing instruction must begin with the name of the target.
- Xml解析:关于“The processing instruction must begin with the name of the target”
- org.hibernate.QueryException: query must begin with SELECT or FROM: delete
- org.hibernate.QueryException: query must begin with SELECT or FROM: delete
- Caused by: org.hibernate.QueryException: query must begin with SELECT or FROM:
- A JSONObject text must begin with '{' at character 1 of 1
- org.json.JSONException: A JSONObject text must begin with '{' at character 1 of {解决方法
- Java中json数据问题.报错 A JSONObject text must begin with '{'
- org.hibernate.QueryException: query must begin with SELECT or FROM: delete
- 173. Binary Search Tree Iterator
- 把view保存成bitmap,保存bitmap到sd卡
- BZOJ4246: 两个人的星座
- uC/OS-ii系统内核理解(三)_初始化调用函数
- 文件特殊权限:SUID,SGID和SBIT
- ReactJS component names must begin with capital letters?!
- Codeforces 765F. Souvenirs
- 003_Windows程序设计--窗口与消息
- C++静态链接库
- 类加载机制
- QQ第三方登录实例demo(QQSDK包优化)
- 二十四节气的计算方法
- Spring Boot 静态资源处理
- Poj 1094 Sorting It All Out 【拓扑排序】