({ label, id }: SimpleElement)
| 118 | }); |
| 119 | |
| 120 | function HookSetSize({ label, id }: SimpleElement) { |
| 121 | const set = useUpdateElement(id, 'size'); |
| 122 | |
| 123 | return ( |
| 124 | <HTMLNode className="node"> |
| 125 | <button |
| 126 | className={BUTTON_CLASSNAME} |
| 127 | onClick={() => |
| 128 | set((previous) => { |
| 129 | if (previous === undefined) { |
| 130 | return { width: 0, height: 0 }; |
| 131 | } |
| 132 | return { width: previous.width + 10, height: previous.height + 10 }; |
| 133 | }) |
| 134 | } |
| 135 | > |
| 136 | Set size |
| 137 | </button> |
| 138 | label: {label} |
| 139 | </HTMLNode> |
| 140 | ); |
| 141 | } |
| 142 | |
| 143 | export const SetSize: Story = makeStory<Story>({ |
| 144 | component: () => <RenderItemDecorator renderElement={HookSetSize} />, |
nothing calls this directly
no test coverage detected