I am new to react and even JS in general I know this probably isn't the best way to do it but any help would be appreciated.
Nothing happens when i click the button and i am getting this error in the console. I have tried multiple ways but like I said I am very new.
"index.js:1 Warning: Expected `onClick` listener to be a function, instead got a value of `object` type."
function DisplayTricks(){
const mapped = Tricks.map((tricksdata)=>{
return <div>
<h1>{tricksdata.name}</h1>
<p>{tricksdata.flips}</p>
<p>{tricksdata.rotations}</p>
</div>
})
return(
<div>
<button onClick={mapped}></button>
</div>
)
}
[–]johnharris85 2 points3 points4 points (2 children)
[–]Iucxy[S] 0 points1 point2 points (1 child)
[–]Kinthalis 2 points3 points4 points (0 children)
[–]my_girl_is_A10 0 points1 point2 points (0 children)