Files
react.dev/examples/context/theme-detailed-themed-button.js
Alex Krolick 8437e3767b Fix syntax
2018-03-23 13:55:35 -07:00

18 lines
338 B
JavaScript

import {ThemeContext} from './theme-context';
function ThemedButton(props) {
// highlight-range{2-9}
return (
<ThemeContext.Consumer>
{theme => (
<button
{...props}
style={{backgroundColor: theme.background}}
/>
)}
</ThemeContext.Consumer>
);
}
export default ThemedButton;