Facebook
From fjamma, 4 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 626
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3.  
  4. const App = () => {
  5.     let myWindow;
  6.  
  7.     const openWindow = () => {
  8.         myWindow = window.open('https://google.com')
  9.     }
  10.  
  11.     const closeWindow = () => {
  12.         myWindow.close()
  13.     }
  14.  
  15.     return (
  16.         <div>
  17.             <button onClick={openWindow}>Open</button>
  18.             <button onClick={closeWindow}>Close</button>
  19.         </div>
  20.     )
  21. }
  22.  
  23. ReactDOM.render(<App />, document.getElementById('root'))

Replies to Untitled rss

Title Name Language When
Re: Untitled Little Gorilla javascript 2 Years ago.
Re: Untitled Colorant Dolphin javascript 3 Years ago.