Skip to content

Commit 6b656c1

Browse files
committed
update ReactComponent.js
1 parent 0875e2b commit 6b656c1

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

packages/react-ape/renderer/reactApeComponent.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const ReactApeComponent = {
3434
});
3535

3636
const tag = '[CREATE_ELEMENT]';
37-
3837
if (type === 'Button') {
3938
const {ctx} = apeContextGlobal;
4039
ctx.canvas.addEventListener(
@@ -49,21 +48,21 @@ const ReactApeComponent = {
4948
* Handling click button event
5049
* @param {*} event
5150
*/
52-
const onClick = (event: SyntheticMouseEvent<HTMLButtonElement>) => {
53-
const rect = {
54-
x,
55-
y,
56-
height,
57-
width,
58-
};
59-
const mousePosition = trackMousePosition(ctx.canvas, event);
60-
if (isMouseInside(mousePosition, rect)) {
61-
//redrawButton(ctx);
62-
if (props.onClick && typeof props.onClick === 'function') {
63-
props.onClick(event);
64-
}
65-
}
66-
};
51+
// const onClick = (event: SyntheticMouseEvent<HTMLButtonElement>) => {
52+
// const rect = {
53+
// x,
54+
// y,
55+
// height,
56+
// width,
57+
// };
58+
// const mousePosition = trackMousePosition(ctx.canvas, event);
59+
// if (isMouseInside(mousePosition, rect)) {
60+
// //redrawButton(ctx);
61+
// if (props.onClick && typeof props.onClick === 'function') {
62+
// props.onClick(event);
63+
// }
64+
// }
65+
// };
6766
const COMPONENTS = {
6867
...customDict,
6968
Image: Image(props),

0 commit comments

Comments
 (0)