Skip to content

Commit

Permalink
fix: Fix withAuth export
Browse files Browse the repository at this point in the history
  • Loading branch information
hmvp committed Apr 20, 2020
1 parent d5dce04 commit 4e0e2e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ___

### withAuth

**withAuth**<**P**>(`Component`: React.ComponentType‹P›): *FunctionComponent‹object*
**withAuth**<**P**>(`Component`: React.ComponentType‹P›): *React.ComponentType‹Omit‹P, keyof AuthContextProps›*

A public higher-order component to access the imperative API

Expand All @@ -69,4 +69,4 @@ Name | Type |
------ | ------ |
`Component` | React.ComponentType‹P› |

**Returns:** *FunctionComponent‹object*
**Returns:** *React.ComponentType‹Omit‹P, keyof AuthContextProps›*
4 changes: 2 additions & 2 deletions src/withAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import React from 'react';
/**
* A public higher-order component to access the imperative API
*/
export default function withAuth<P extends AuthContextProps>(
export function withAuth<P extends AuthContextProps>(
Component: React.ComponentType<P>,
) {
): React.ComponentType<Omit<P, keyof AuthContextProps>> {
const displayName = `withAuth(${Component.displayName || Component.name})`;
const C: React.FC<Omit<P, keyof AuthContextProps>> = (props) => {
const auth = useAuth();
Expand Down

0 comments on commit 4e0e2e1

Please sign in to comment.