When you're building your React components, you'll probably want to access child properties of the markup. Parent can read its children by accessing the special this.props.children prop.this.props.children is an opaque data structure: use the React.C…
When you're building your React components, you'll probably want to access child properties of the markup. In Angular, it is transcludion: <div> <ng-transculde></ng-transclude> </div> In React, it is: {this.props.children} It means…
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.Pr…
the transferPropsTo method lets you easily push properties into your components to easily customize attributes. From last two exmaples, we have BButton adn BHeart set up. var BButton = React.createClass({ render: function() { return ( <a className=&quo…
State is used for properties on a component that will change, versus static properties that are passed in. This lesson will introduce you to taking input within your React components. Unlike props, which are meant to be passed into our component as s…
State is used for properties on a component that will change, versus static properties that are passed in. This lesson will introduce you to taking input within your React components. Properties vs. State When you think of properties, you should be t…
To make more composable React components, you can define common APIs for similar component types. import React from 'react'; import ReactDOM from 'react-dom'; export default class App extends React.Component{ constructor(){ super(); this.state = { re…
The React component lifecycle will allow you to update your components at runtime. This lesson will explore how to do that. import React from 'react'; import ReactDOM from 'react-dom'; export default class App extends React.Component { constructor(){…
The previous lesson introduced the React component lifecycle mounting and unmounting. In this lesson you will learn some simple uses for these hooks. import React from 'react'; import ReactDOM from 'react-dom'; class App extends React.Component { con…
React components have a lifecycle, and you are able to access specific phases of that lifecycle. This lesson will introduce mounting and unmounting of your React components. import React from 'react'; import ReactDOM from 'react-dom'; export default…