Mui Joy Button doesn't work
Answered
French Lop posted this in #help-forum
French LopOP
const handleClick = () => {
console.log("clicked")
}
return (
#Unknown Channel
<Button onClick={handleClick}>Register</Button>
</>
)
when i click the button nothing happens idk why
console.log("clicked")
}
return (
#Unknown Channel
<Button onClick={handleClick}>Register</Button>
</>
)
when i click the button nothing happens idk why
28 Replies
where is
Button definedFrench LopOP
import { Button, Typography } from '@mui/joy'
and do normal onclicks for buttons work?
as if so, you should bring this up with mui as nextjs can't control it as far as i know
@riský and do normal onclicks for buttons work?
French LopOP
what do you mean with a normal onClick?
like create a button (just plain and basic one)
and put the same onClick event on it
French LopOP
nah its not working
i am on a client component
lol i just had a convo about this a few hours ago: https://canary.discord.com/channels/752553802359505017/1155683425886425099/1155728855089283082
but you say that you just did a
<button onClick={handleClick}>Register</button> not imported anywhereFrench LopOP
<button onClick={handleClick}>CLICK IT</button>
yes the basic html button also didnt work
yes the basic html button also didnt work
firstly, can you try clearing .next folder
secondly, check that js isn't disabled in your browser (and tab)
thirdly, make sure
secondly, check that js isn't disabled in your browser (and tab)
thirdly, make sure
button isn't imported/defined anywhere elseFrench LopOP
nothing helps
and can you try a fresh project (next build && next start) with just that code
French LopOP
maybe theres a problem because i am using src folder
it shouldn't do anything negatively
and you are using
nextjs v13.5.2? (latest)French LopOP
yes its the latest next version
v16.10.0 for node
French LopOP
i will try a new project maybe just a weird bug
@French Lop v16.10.0 for node
tbh you should update as 18 is LTS now or 20 for latest
Answer
French LopOP
lamo using v20 now
its working
my bad i thought v16.10 works but next requires 16.14
well thats a different bug, but yay its fixed!
French LopOP
thanks a lot 😄