score:1

Accepted answer

an if statement can only return one element, in this case you're trying to return two <link> and <button> to make this in to one use a <react.fragment>

example

const imageframe = ({ movieid, moviename, searchword, image, personmovieid, clickable, clearfavouritemovie }) => {

return (
        <div classname = "col-sm-3 mt-5 animated fadeinleftbig ">
            { clickable ? /* if clickable props is true --> go movie, else go movie again but with personal movie id ! */
                 <react.fragment>
                 <link to={{ pathname:`/movie/${movieid}`, moviename: `${moviename}`, searchword: `${searchword}` }}>
                    <card classname = "card-box image-frame  ">
                        <card.img variant="top" src={image} alt="movieimg" />
                    </card>
                    </link> **!!! i want link component stays here !!!** 
                    { 
                        clearfavouritemovie && <button
                            classname = "mt-3 btn btn-warning"
                            onclick = { () => clearfavouritemovie(movieid)}
                        > bu filmi sil </button> 
                    }
                </react.fragment>
                : 
                <link to = {{pathname: `/movie/${personmovieid}`}}>  {/* person known for movies*/}
                <card classname = "bg-dark text-light card-box  image-frame " style = {{maxheight: "500px"}}>
                    <card.img variant="top" src={image} alt="movieimg" />
                </card>
                </link>
            }            
        </div>
    )

Related Query

More Query from same tag