Next.js Discord

Discord Forum

Buttons just don't work

Answered
Golden-cheeked Warbler posted this in #help-forum
Open in Discord
Golden-cheeked WarblerOP
It's my first time using nextjs. I've had some experience with React before and decide to try nextjs. trying to implement a simple button clicking project. However the button is not reacting at all
Answered by Golden-cheeked Warbler
It was due to my node version v16.9.1. I've updated it to the latest and it works normally
View full answer

21 Replies

reload the page and if it didn't work remove the .next folder and restart the dev server
Golden-cheeked WarblerOP
Doesn't work even if I re-create the project for some reason
Golden-cheeked WarblerOP
i've tried npm run dev and npx next dev
@Golden-cheeked Warbler i've tried npm run dev and npx next dev
can you show where you're mounting this component
Golden-cheeked WarblerOP
just calling it in page.tsx
Maybe im just over lookin this but wouldn’t it be
onClick={() => handleClick}
Golden-cheeked WarblerOP
@!isColonel Maybe im just over lookin this but wouldn’t it be js onClick={() => handleClick}
Golden-cheeked WarblerOP
tried, doesn't work
Ya idk why i thought that
Golden-cheeked WarblerOP
even this doesn't work
what's on the screen?
Golden-cheeked WarblerOP
just the button
that's very weird
Golden-cheeked WarblerOP
i just run
npx create-next-app@latest

and
npm run dev
Cant log a boolean unless its a string
Golden-cheeked WarblerOP
tried loggin string before, doesnt work
sometime I encounter this error
Golden-cheeked WarblerOP
It was due to my node version v16.9.1. I've updated it to the latest and it works normally
Answer