Add react-no-ssr types, fix compile-time ESLint/type issues

This commit is contained in:
Xevion
2023-02-16 04:33:31 -06:00
parent e83fd2a568
commit d1cb7c3fb8
4 changed files with 11 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ const IconInternal: FunctionComponent<IconInternalProps> = ({label, children}) =
}
const DisplayIconSingle: FunctionComponent<DisplayIconSingleProps> = ({setId, id}) => {
// eslint-disable-next-line
const IconSet = loadable.lib(() => getIcons(setId));
return <IconSet fallback={<IconInternal label={"Loading..."} />} >

View File

@@ -1,4 +1,5 @@
import codegen from "babel-plugin-codegen/macro";
import {IconType} from "react-icons";
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call */
// language=JavaScript
@@ -13,7 +14,7 @@ const fn = codegen`
`;
/* eslint-enable */
export function getIcons(id: string) {
export function getIcons(id: string): Promise<{[id: string]: IconType}> {
/*
Dynamic Import with improved performance.
Macros are used to avoid bundling unnecessary modules.