Expected onclick
listener to be a function, instead got a value of string
type.
getListener@http://localhost:3000/static/js/bundle.js:18256:15
accumulateSinglePhaseListeners@http://localhost:3000/static/js/bundle.js:22846:39
onClick={Window.href=’https://github.com/’}
I am using react js. During on click event shows the above error tell me how I can solve it I will be very glad?
`My on click event is not working while using react`
2
Answers
Try doing this :
As the error states, the
onClick
handler expects a function, not a string. Just wrap your sample with a function call.