This lesson will teach you the basics of setting properties in your React components.

class App extends React.Component {
render(){
let txt = this.props.txt
return <h1>{txt}</h1>
}
} App.propTypes = {
txt: React.PropTypes.string,
cat: React.PropTypes.number.isRequired
} App.defaultProps ={
txt: 'this is the default txt'
} ReactDOM.render(
<App cat={5} />,
document.getElementById('app')
);

[React Fundamentals] Introduction to Properties的更多相关文章

  1. [React Fundamentals] Accessing Child Properties

    When you're building your React components, you'll probably want to access child properties of the m ...

  2. [React] React Fundamentals: Accessing Child Properties

    When you're building your React components, you'll probably want to access child properties of the m ...

  3. [React Fundamentals] State Basics

    State is used for properties on a component that will change, versus static properties that are pass ...

  4. [React] React Fundamentals: transferPropsTo

    the transferPropsTo method lets you easily push properties into your components to easily customize ...

  5. [React] React Fundamentals: State Basics

    State is used for properties on a component that will change, versus static properties that are pass ...

  6. [React Fundamentals] Composable Components

    To make more composable React components, you can define common APIs for similar component types. im ...

  7. [React Fundamentals] Component Lifecycle - Updating

    The React component lifecycle will allow you to update your components at runtime. This lesson will ...

  8. [React Fundamentals] Component Lifecycle - Mounting Usage

    The previous lesson introduced the React component lifecycle mounting and unmounting. In this lesson ...

  9. [React Fundamentals] Component Lifecycle - Mounting Basics

    React components have a lifecycle, and you are able to access specific phases of that lifecycle. Thi ...

随机推荐

  1. vfp 操作excel

    VFP全面控制EXCEL 收藏 VFP和Excel都可以用来进行处理数据库表格,如果巧妙地将二者的优点结合起来,将会大大方便我们的工作.比如我们可以利用VFP进行处理数据,而利用Excel的预览打印功 ...

  2. TortoiseGit连接github不用每次输入用户名和密码的方法

    每次git clone 和push 都要输入用户名和密码.虽然安全,但在本机上每次都输有些麻烦,如何记住用户名和密码呢? 当你配置好git后,在C:\Documents and Settings\Ad ...

  3. 在ASP.NET中各种跳转控制

    在ASP.NET中各种跳转控制 分类: 我的资料2012-03-16 15:01 76人阅读 评论(0) 收藏 举报 asp.netjavascripturlmenu Respose.Write(&q ...

  4. ViewPager 滑动页(一)

    需求:滑动展示页,能够使用本地数据,及获取服务器数据进行刷新操作: 效果图: 实现分析: 1.目录结构: 代码实现: 1.fragment_main.xml <RelativeLayout xm ...

  5. 淘宝JAVA中间件Diamond详解(2)-原理介绍

    淘宝JAVA中间件Diamond详解(二)---原理介绍 大家好,通过第一篇的快速使用,大家已经对diamond有了一个基本的了解.本次为大家带来的是diamond核心原理的介绍,主要包括server ...

  6. qtp不识别树结构中的点击事件

    qtp不识别树结构中的点击事件,未生成该点击事件的脚本,解决办法: 1.未生成点击"auto分类c1"的脚本 2.点击1.对象库-2.添加对象库-3.选中对象-点击OK,即将该对象 ...

  7. js基础第3天

    仿淘宝搜索框案例(有价值) 判断用户输入事件 正常浏览器:oninput(判断用户输入) ie678浏览器兼容:onpropertychange(因为兼容性问题, ie浏览器678是需要使用这个来判断 ...

  8. ubuntu启用root用户

    在安装Ubuntu时系统会提示你创建一个用户,但是该用户不具备ROOT权限.但是此时系统是有root用户的,root密码是随机的,如果你想使用root用户需要更改root密码.用你安装系统时创建的用户 ...

  9. 2.2CUDA-Memory(存储)和bank-conflict

    在CUDA基本概念介绍有简单介绍CUDA memory.这里详细介绍: 每一个线程拥有自己的私有存储器,每一个线程块拥有一块共享存储器(Shared memory):最后,grid中所有的线程都可以访 ...

  10. leetcode@ [211] Add and Search Word - Data structure design

    https://leetcode.com/problems/add-and-search-word-data-structure-design/ 本题是在Trie树进行dfs+backtracking ...