Skip to content

Commit 449d739

Browse files
authored
Fix #216 (#218)
* Revert "fix: Removed defaultProps to support react 19 (#211)" This reverts commit 7f3daef. * fix issue #216 cause app to freeze
1 parent 08da269 commit 449d739

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

src/devToolUI.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const DevToolUI: React.FC<DevtoolUIProps> = ({
9090
background: 'none',
9191
...styles?.button,
9292
}}
93+
type="button"
9394
>
9495
<Logo actions={actions} />
9596
</Button>

src/formStateTable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const FormStateTable = ({
130130
onClick={() => {
131131
setShowFormState(!showFormState);
132132
}}
133+
type="button"
133134
>
134135
<span
135136
style={{

src/panel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ const Panel = ({ control, control: { _fields } }: { control: Control }) => {
148148
}}
149149
title="Update values and state the form"
150150
onClick={() => setData({})}
151+
type="button"
151152
>
152153
♺ REFRESH
153154
</Button>
@@ -162,6 +163,7 @@ const Panel = ({ control, control: { _fields } }: { control: Control }) => {
162163
onClick={() => {
163164
actions.setCollapse(!state.isCollapse);
164165
}}
166+
type="button"
165167
>
166168
{state.isCollapse ? '[-] COLLAPSE' : '[+] EXPAND'}
167169
</Button>

src/panelTable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const PanelTable = ({
9191
textAlign: 'center',
9292
marginRight: 8,
9393
}}
94+
type="button"
9495
>
9596
{collapse ? '+' : '-'}
9697
</Button>
@@ -114,6 +115,7 @@ const PanelTable = ({
114115
? {}
115116
: { cursor: 'not-allowed', background: colors.lightBlue }),
116117
}}
118+
type="button"
117119
>
118120
{isNative ? 'Native' : 'Custom'}
119121
</Button>

src/styled.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import styled from '@emotion/styled';
32

43
import colors from './colors';
@@ -8,16 +7,7 @@ export const paraGraphDefaultStyle = {
87
lineHeight: '20px',
98
};
109

11-
interface ButtonBaseProps
12-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13-
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
14-
}
15-
16-
const ButtonBase = ({ type = 'button', ...props }: ButtonBaseProps) => {
17-
return <ButtonBase type={type} {...props} />;
18-
};
19-
20-
const Button = styled(ButtonBase)<{ hideBackground?: boolean }>`
10+
const Button = styled.button<{ hideBackground?: boolean }>`
2111
appearance: none;
2212
margin: 0;
2313
border: 0;

0 commit comments

Comments
 (0)