DEV Community

Cover image for HookedElements: hooks in WickedElements
artydev
artydev

Posted on

1

HookedElements: hooks in WickedElements

You missed hooks in WickedElements, don't worry anymore Andrea provided them for us :-)

You can test it here : HookedElements

<button class="counter"></button>
<button class="counter"></button>
<button class="counter"></button>
Enter fullscreen mode Exit fullscreen mode
// define via callback to receives the element right away
import {define, useState} from 'hooked-elements';

define('button.counter', element => {
  const [count, update] = useState(0);
  element.onclick = () => update(count + 1);
  element.textContent = `${count} clicks`;
});
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay