const thing = () => {
let selectedPage = "hello"
const addCduPageButton = () => {
return (
<div>
<button onClick={addCduPage(selectedPage)}>Add Page</button>
</div>
)
}
const addCduPage = (value: string) => {
console.log(value)
}
return(
<div>
{addCduPageButton}
</div>
)
}
export default thing;
https://i.stack.imgur.com/NJN1U.png
类型'void'不能分配给类型'((event:MouseEvent
我不了解按钮的onClick属性的问题。