diff --git a/dist/index.d.ts b/dist/index.d.ts index 4de724d..8743d4f 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,8 +1,8 @@ -import React from 'react'; +import React, { ReactNode } from 'react'; type ReactAndProps = { children?: React.ReactNode; conjuction?: string; oxfordComma?: boolean; }; -declare const ReactAnd: ({ children, conjuction, oxfordComma }: ReactAndProps) => JSX.Element; +declare const ReactAnd: ({ children, conjuction, oxfordComma }: ReactAndProps) => ReactNode; export default ReactAnd; diff --git a/package.json b/package.json index 25d55eb..795aef6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-and", - "version": "2.0.0", + "version": "2.0.1", "description": "A lightweight React component for joining multiple components in a grammatically correct way.", "keywords": [ "react", diff --git a/src/index.tsx b/src/index.tsx index 7e3bb99..dfb5401 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { ReactNode } from 'react'; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type ReactAndProps = { @@ -7,7 +7,7 @@ type ReactAndProps = { oxfordComma?: boolean; } -const ReactAnd = ({ children, conjuction = 'and', oxfordComma = true }: ReactAndProps) => { +const ReactAnd = ({ children, conjuction = 'and', oxfordComma = true }: ReactAndProps): ReactNode => { if (!children) { return <>; }