Open
Description
π Search Terms
isolatedDeclarations quickfix TS9023
π Version & Regression Information
This is an error in the new QuickFix in TS 5.5 to enable isolatedDeclarations.
β― Playground Link
No response
π» Code
When activating isolatedDeclarations this code does not compile.
export function ImportExcelProgressModal(): React.JSX.Element {
return <div></div>;
}
//Error (active) TS9023 Build:Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function.
ImportExcelProgressModal.show = (): Promise<boolean> => {
return openModal(<ImportExcelProgressModal/>);
};
π Actual behavior
After executing the quick fix it produces code with two errors:
export function ImportExcelProgressModal(): React.JSX.Element {
return <div></div>;
}
export declare namespace ImportExcelProgressModal {
//Error (active) TS2300 (TS) Duplicate identifier 'show'.
export var show: () => Promise<bool>;
}
//Error (active) TS2300 (TS) Duplicate identifier 'show'.
ImportExcelProgressModal.show = (): Promise<boolean> => {
return openModal(<ImportExcelProgressModal/>);
};
π Expected behavior
but this (sorter) code would work:
export function ImportExcelProgressModal(): React.JSX.Element {
return <div></div>;
}
export namespace ImportExcelProgressModal {
export let show = (): Promise<boolean> => {
return openModal(<ImportExcelProgressModal/>);
};
}
If ImportExcelProgressModal
would have been exported as default
then this would be the solution:
function ImportExcelProgressModal(): React.JSX.Element {
return <div></div>;
}
namespace ImportExcelProgressModal {
export let show = (): Promise<boolean> => {
return openModal(<ImportExcelProgressModal/>);
};
}
export default ImportExcelProgressModal;
Additional information about the issue
No response