Skip to content

Commit ecfe6bd

Browse files
committed
change all React.FormEvent to React.ChangeEvent
1 parent 196bc70 commit ecfe6bd

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

packages/editor/src/Theme/FontSizes.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ const FontSizes = () => {
77
const context = useThemeUI() as EditorContextValue
88
const { fontSizes = [] } = context.theme
99

10-
const onChange = (key: string) => (e: React.FormEvent<HTMLInputElement>) => {
11-
// TODO: I needed to swap target to currentTarget because TypeScript complains about "Property 'value' does not exist on type 'EventTarget'.ts(2339)". Should I change it back or leave as is?
12-
const n = parseFloat(e.currentTarget.value)
10+
const onChange = (key: string) => (
11+
e: React.ChangeEvent<HTMLInputElement>
12+
) => {
13+
const n = parseFloat(e.target.value)
1314
if (Array.isArray(fontSizes)) {
1415
const i = parseInt(key)
1516
context.setTheme({

packages/editor/src/Theme/LineHeights.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export default () => {
77
const context = useThemeUI() as EditorContextValue
88
const { lineHeights = {} } = context.theme
99

10-
const onChange = (key: string) => (e: React.FormEvent<HTMLInputElement>) => {
11-
// TODO: I needed to swap target to currentTarget because TypeScript complains about "Property 'value' does not exist on type 'EventTarget'.ts(2339)". Should I change it back or leave as is?
12-
const n = parseFloat(e.currentTarget.value)
10+
const onChange = (key: string) => (
11+
e: React.ChangeEvent<HTMLInputElement>
12+
) => {
13+
const n = parseFloat(e.target.value)
1314
context.setTheme({
1415
lineHeights: {
1516
[key]: n,

packages/editor/src/Theme/Space.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ const Space = () => {
99
const context = useThemeUI() as EditorContextValue
1010
const { space = defaultSpace } = context.theme
1111

12-
const onChange = (key: string) => (e: React.FormEvent<HTMLInputElement>) => {
13-
// TODO: I needed to swap target to currentTarget because TypeScript complains about "Property 'value' does not exist on type 'EventTarget'.ts(2339)". Should I change it back or leave as is?
14-
const n = parseFloat(e.currentTarget.value)
12+
const onChange = (key: string) => (
13+
e: React.ChangeEvent<HTMLInputElement>
14+
) => {
15+
const n = parseFloat(e.target.value)
1516
if (Array.isArray(space)) {
1617
const i = parseInt(key)
1718
context.setTheme({

0 commit comments

Comments
 (0)