You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
476 B
23 lines
476 B
function ThemedButton(props) {
|
|
//highlight-range{1}
|
|
return <Button theme={props.theme} />;
|
|
}
|
|
|
|
// An intermediate component
|
|
function Toolbar(props) {
|
|
// highlight-range{1-2,5}
|
|
// The Toolbar component must take an extra theme prop
|
|
// and pass it to the ThemedButton
|
|
return (
|
|
<div>
|
|
<ThemedButton theme={props.theme} />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
class App extends React.Component {
|
|
render() {
|
|
// highlight-range{1}
|
|
return <Toolbar theme="dark" />;
|
|
}
|
|
}
|
|
|