<button onClick={() => { console.log(this.id); //this doesn't work because "self" is not defined. }}> Click me</button>
<button onClick={() => { console.log(this.id); //this doesn't work because "self" is not defined. }}> Click me</button>
This seems like a really simple question, but I kinda struggled with finding a solution, other then wrapping it in a component and getting/managing the id like that. Thanks for the help! =)
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
S
SolidJS
Solid is a declarative reactive Javascript library for creating user interfaces.