DEV Community

amrit853200
amrit853200

Posted on

would like to render the infoPage.js when the user clicks to handleClick function in react. Help Appreciated?



infoPage.js

import React from 'react'

export default function infoPage() {
    return (
        <div>
            <h1> this is info components</h1>
        </div>
    )
}


App.js:

<button className="btn btn-primary" onClick={handleClick}>{value.title}</button>



Function:

const handleClick = () => {
   const url = infoPage;
   window.open(url, '_blank');
 } 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)