فهرست منبع

meta: resolve jsx to Preact in shared tsconfig (#4923)

Merlijn Vos 1 سال پیش
والد
کامیت
ab7ed608dc
3فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      packages/@uppy/audio/src/AudioSourceSelect.tsx
  2. 2 3
      packages/@uppy/image-editor/src/Editor.tsx
  3. 1 0
      tsconfig.shared.json

+ 1 - 1
packages/@uppy/audio/src/AudioSourceSelect.tsx

@@ -16,7 +16,7 @@ export default ({
       <select
         className="uppy-u-reset uppy-Audio-audioSource-select"
         onChange={(event) => {
-          onChangeSource(event.target.value)
+          onChangeSource((event.target as HTMLSelectElement).value)
         }}
       >
         {audioSources.map((audioSource) => (

+ 2 - 3
packages/@uppy/image-editor/src/Editor.tsx

@@ -1,7 +1,6 @@
 /* eslint-disable jsx-a11y/label-has-associated-control */
 import Cropper from 'cropperjs'
 import { h, Component } from 'preact'
-import type { ChangeEvent } from 'react'
 import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile'
 import type { I18n } from '@uppy/utils/lib/Translator'
 import getCanvasDataThatFitsPerfectlyIntoContainer from './utils/getCanvasDataThatFitsPerfectlyIntoContainer.ts'
@@ -119,9 +118,9 @@ export default class Editor<M extends Meta, B extends Body> extends Component<
     this.cropper.setCropBoxData(newCanvasData)
   }
 
-  onRotateGranular = (ev: ChangeEvent<HTMLInputElement>): void => {
+  onRotateGranular = (ev: Event): void => {
     // 1. Set state
-    const newGranularAngle = Number(ev.target.value)
+    const newGranularAngle = Number((ev.target as HTMLInputElement).value)
     this.setState({ angleGranular: newGranularAngle })
 
     // 2. Rotate the image

+ 1 - 0
tsconfig.shared.json

@@ -13,6 +13,7 @@
     "emitDeclarationOnly": true,
     "declarationMap": true,
     "jsx": "preserve",
+    "jsxImportSource": "preact",
     "noImplicitAny": true,
     "noImplicitThis": true,
     "strictNullChecks": true,