diff options
author | bobzel <zzzman@gmail.com> | 2024-09-02 09:26:37 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-09-02 09:26:37 -0400 |
commit | cda69e48361fce8d71a4dc66edd9dd976a27f52d (patch) | |
tree | 82b9a1a5967ae88a9534f89f7eaed3aeb289652f /src/client/views/ObservableReactComponent.tsx | |
parent | c01828308714874589d1f60c33ca59df4c656c0c (diff) | |
parent | a958577d4c27b276aa37484e3f895e196138b17c (diff) |
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/ObservableReactComponent.tsx')
-rw-r--r-- | src/client/views/ObservableReactComponent.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/ObservableReactComponent.tsx b/src/client/views/ObservableReactComponent.tsx index 34da82b6c..bb7a07f0e 100644 --- a/src/client/views/ObservableReactComponent.tsx +++ b/src/client/views/ObservableReactComponent.tsx @@ -8,27 +8,27 @@ import JsxParser from 'react-jsx-parser'; * This is an abstract class that serves as the base for a PDF-style or Marquee-style * menu. To use this class, look at PDFMenu.tsx or MarqueeOptionsMenu.tsx for an example. */ -export abstract class ObservableReactComponent<T> extends React.Component<T, {}> { +export abstract class ObservableReactComponent<T> extends React.Component<T, object> { @observable _props: React.PropsWithChildren<T>; - constructor(props: any) { + constructor(props: React.PropsWithChildren<T>) { super(props); this._props = props; makeObservable(this); } componentDidUpdate(prevProps: Readonly<T>): void { Object.keys(prevProps) - .filter(pkey => (prevProps as any)[pkey] !== (this.props as any)[pkey]) + .filter(pkey => (prevProps as {[key:string]: unknown})[pkey] !== (this.props as {[key:string]: unknown})[pkey]) .forEach(action(pkey => { - (this._props as any)[pkey] = (this.props as any)[pkey]; + (this._props as {[key:string]: unknown})[pkey] = (this.props as {[key:string]: unknown})[pkey]; })); // prettier-ignore } } class ObserverJsxParser1 extends JsxParser { - constructor(props: any) { + constructor(props: object) { super(props); - observer(this as any); + observer(this as typeof JsxParser); } } -export const ObserverJsxParser: typeof JsxParser = ObserverJsxParser1 as any; +export const ObserverJsxParser = ObserverJsxParser1 as typeof JsxParser; |