SHARE
TWEET

Untitled

a guest Dec 13th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="body"> </div>
  2.     <script crossorigin src="https://unpkg.com/react@15/dist/react.js"></script>
  3. <script crossorigin src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
  4. <script src="https://npmcdn.com/babel-core@5.8.38/browser.min.js"></script>
  5. <script src="https://soulwire.github.io/sketch.js/js/sketch.min.js"></script>
  6.     <script type="text/babel">
  7.  
  8. class Container extends React.Component {
  9.   render() {
  10.     return (
  11.       <div id="wrapper">
  12.       </div>
  13.     );
  14.   }
  15. }
  16. const Component = document.querySelector('#body');
  17. ReactDOM.render(<Container />, Component);
  18.    
  19. add('#body', 'header');
  20. add('#wrapper', 'main');
  21.  
  22. function add ( containerName, tag, content='' ){
  23.     let tagName = document.createElement(tag);
  24.     let container = document.querySelector(containerName);
  25.     tagName.innerHTML = content;
  26.     container.appendChild(tagName);
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top