How to use onClick event on react Link component? December 19, 2022 by Tarik You are passing hello() as a string, also hello() means execute hello immediately. try onClick={hello}