Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import React from 'react';
  2. import { ThemeContext } from '../';
  3.  
  4. const ContextMiddleUse = () => (
  5. <ThemeContext.Consumer>
  6. {value => (
  7. <div
  8. style={{
  9. backgroundColor: value === 'light' ? 'white' : 'black',
  10. color: value === 'light' ? 'black' : 'white',
  11. }}>
  12. Context Middle Use
  13. </div>
  14. )}
  15. </ThemeContext.Consumer>
  16. );
  17.  
  18. export default ContextMiddleUse;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement