The owner-ownee relationship is used to designate a parent-child relationship with React components as it differs from the DOM relationship. When one component renders another component, this is what React refers to as the "owner-ownee relationship,&…
The owner-ownee relationship is used to designate a parent-child relationship with React components as it differs from the DOM relationship. import React from 'react'; export default class App extends React.Component { constructor(){ super(); //This…
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…
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…
When you are using React components you need to be able to access specific references to individual components. This is done by defining a ref. Notice: 'ref' only works in class component, not in statless component. If we don't add "ref", three…
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…
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…