From 85139abd2e94f10f638ec67a31bb45185cd0a7c4 Mon Sep 17 00:00:00 2001 From: Muhammad Fawwaz Orabi Date: Sun, 3 Dec 2017 01:59:49 +0200 Subject: [PATCH] fix: Improve TypeScript type checking for module exports If key is a string, it must be a key of the export module object. This helps avoid typos. --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 93237cf..a5bd5c8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -73,7 +73,7 @@ declare module 'react-universal-component' { * It can be a string corresponding to the export key, or a function that's * passed the entire module and returns the export that will become the component. */ - key: string | ((module: Export) => ComponentType

); + key: keyof Export | ((module: Export) => ComponentType

); /** * Allows you to specify a maximum amount of time before the error component