mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 23:12:03 +08:00
17 lines
322 B
TypeScript
17 lines
322 B
TypeScript
import React, { FC, useState } from 'react';
|
|
|
|
const ButtonWithState: FC = () => {
|
|
const [count, setCount] = useState(0);
|
|
return (
|
|
<button type="button" onClick={() => setCount(count + 1)}>
|
|
{`count: ${count}`}
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default {
|
|
component: ButtonWithState,
|
|
};
|
|
|
|
export const Basic = {};
|