Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

opening a link in another tab in react

import React from "react";

function App() {
  const handleClick = () => {
    window.open("http://twitter.com/saigowthamr");
  };

  return (
    <div>
      <h2>App</h2>
      <button onClick={handleClick}>Twitter</button>
    </div>
  );
}

export default App;
Source by reactgo.com #
 
PREVIOUS NEXT
Tagged: #opening #link #tab #react
ADD COMMENT
Topic
Name
3+1 =