Vega-Lite
というReactクラスをVoyager
というプロジェクトからインポートしようとしています。ここでJSX要素タイプ 'xxx'はJSX要素のコンストラクタ関数ではありません。プロパティ 'yyy'はタイプ 'xxx'で保護されていますが、 'ElementClass'タイプで公開されています
は私のコードです:
import * as React from 'react';
import {VegaLite} from 'datavoyager/build/components/vega-lite';
export interface Props {
spec: any;
logger: any;
}
export const View = ({spec, logger}: Props) => {
return(
<VegaLite spec={spec} logger={logger}/>
);
};
は、ここに私のエラーです:
[ts] JSX element type 'VegaLite' is not a constructor function for JSX elements. Property 'componentDidMount' is protected in type 'VegaLite' but public in type 'ElementClass'.
私はクラスVega-Lite
で、機能componentDidMount()
が実際にprotected
であることを知っています。しかし、どうすればこのエラーを解決できますか?
PS:私はtsconfig.json
にallowSyntheticDefaultImports
~true
を設定しようとしましたが、同じエラーが続きます。
'' tsconfig.json'に '' allowSyntheticDefaultImports ":true'という行がありますか? – Andrew
@Andrewはい私はそれを試みましたが、それはエラーを取り除きません... – CherryQu