Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
React Link to open new tab

I Have a React link in my material table.

  actions={[
         rowData => ({
               icon: () => <Link   style={{ fontSize:"15px" ,fontSize:'15px'}} to={{pathname:'/VV',state: rowData  }} >View</Link> ,
               onClick: (rowData)
             })
           ]} 

I want to be able to open a new tab on the click.

But my child objects keep getting Cannot read properties of undefined when i decide to open it in a new tab

Please can i have some assistance i've been stuck on this problem.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is a simple way you can do that without React-Router library,

Make a Link component like blow and use it.

const Link = () => {
    const linkRef = useRef(null)
    const handleClick = () => {
         linkRef.current.link.click()
    }
    return (
       <div ref={linkRef} onClick={handleClick}> 
          <a href="http://google.com" target="_blank">Go to google!</a>
       </div>
    )
}

You can put the link you want in href and render the Link component where you want! also you can give it a style you want cuz it's a component! :D

I hope you find an answer!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!