Skip to content

Commit

Permalink
fix: Improve TypeScript type checking for module exports
Browse files Browse the repository at this point in the history
If key is a string, it must be a key of the export module object. This helps avoid typos.
  • Loading branch information
forabi committed Dec 2, 2017
1 parent 4c3ce1d commit 85139ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<P>);
key: keyof Export | ((module: Export) => ComponentType<P>);

/**
* Allows you to specify a maximum amount of time before the error component
Expand Down

0 comments on commit 85139ab

Please sign in to comment.