onClick:nextjs 13.5.4 onclick 函数未触发

问题描述 投票:0回答:1

我在 nextjs 13.5.4 中编写了一行简单的代码,涉及一个函数,该函数在调用时应该 console.log 但 onclick 函数似乎没有被触发 我没有收到任何错误或错误,我尝试了不同的技术,但它仍然不起作用

"use client"


import { Button } from "semantic-ui-react"


export default function test () {


function clicks (event){
    console.log("hello am working")
}

    return (
     <>
     <Button onClick={clicks}>click</Button>
     </>
    )
}  ```
reactjs function next.js react-hooks onclick
1个回答
0
投票

您正在查看终端控制台还是浏览器控制台?这将出现在浏览器控制台上。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.