January 2017
Intermediate to advanced
496 pages
10h 7m
English
The components that we've seen so far are completely static in that they take no external input and always render exactly the same. This isn't especially interesting because the same outcome can be achieved by writing plain old HTML. However, React provides a mechanism for making components dynamic by using properties, or props.
Props are passed into a component in order to modify their base definition. Let's take another look at our Title component:
import React, { Component } from 'react';
export default class Title extends Component {
render() {
return (
<h1>
Hello World!
</h1>
);
}
}
While the title of a single article might be Hello World!, this component needs to be more dynamic if it is to be reused within ...
Read now
Unlock full access