Use React hooks inside an MDX story in Storybook

Clarice Bouwer - Jan 13 '22 - - Dev Community
<Story name="With hooks">
  {() => {
    const [count, setCount] = useState(0);
    return (
      <button
        onClick={() => setCount(count + 1)}
      >
        Clicked {count} time(s)
      </button>
    );
  }}
</Story>
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .