Guest User

Untitled

a guest
Nov 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import React from "react";
  2. import ReactDOM from "react-dom";
  3.  
  4. const MyContext = React.createContext({
  5. on: false
  6. });
  7.  
  8. import "./styles.css";
  9.  
  10. class App extends React.Component {
  11. render() {
  12. console.log("context: ", this.context);
  13. return (
  14. <div className="App">
  15. <h1>Hello CodeSandbox</h1>
  16. <h2>Start editing to see some magic happen!</h2>
  17. </div>
  18. );
  19. }
  20. }
  21. App.contextType = MyContext;
  22.  
  23. const rootElement = document.getElementById("root");
  24. ReactDOM.render(<App />, rootElement);
Add Comment
Please, Sign In to add comment