Skip to content

Commit

Permalink
feat: use Renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
SophieManley03 committed Jun 13, 2022
1 parent cf0254c commit bcfa781
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
3 changes: 0 additions & 3 deletions packages/recommend-vdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
"build": "yarn build:clean && yarn build:esm && yarn build:umd && yarn build:types",
"prepare": "yarn build:esm && yarn build:types"
},
"dependencies": {
"preact": "^10.0.0"
},
"devDependencies": {
"@algolia/recommend-core": "1.3.1"
}
Expand Down
16 changes: 5 additions & 11 deletions packages/recommend-vdom/src/types/RecommendComponentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ import { FacetsViewProps } from './FacetsViewProps';
import { RecommendClassNames } from './RecommendClassNames';
import { RecommendStatus } from './RecommendStatus';
import { RecommendTranslations } from './RecommendTranslations';
import { Pragma, PragmaFrag } from './Renderer';
import { Renderer } from './Renderer';
import { ViewProps } from './ViewProps';

export type ItemComponentProps<TObject> = {
item: TObject;
} & RenderProps;
} & Renderer;

export type RenderProps = {
createElement: Pragma;
Fragment: PragmaFrag;
};

export type HeaderComponentProps<TObject> = RenderProps &
ComponentProps<TObject>;
export type HeaderComponentProps<TObject> = Renderer & ComponentProps<TObject>;

export type ComponentProps<TObject> = {
classNames: RecommendClassNames;
Expand All @@ -37,7 +31,7 @@ export type RecommendComponentProps<TObject> = {
items: Array<RecordWithObjectID<TObject>>;
classNames?: RecommendClassNames;
children?(props: ChildrenProps<TObject>): JSX.Element;
fallbackComponent?(props: RenderProps): JSX.Element;
fallbackComponent?(props: Renderer): JSX.Element;
headerComponent?(props: HeaderComponentProps<TObject>): JSX.Element;
status: RecommendStatus;
translations?: RecommendTranslations;
Expand All @@ -55,7 +49,7 @@ export type TrendingComponentProps<TObject> = {
items: Array<FacetEntry<TObject>>;
classNames?: RecommendClassNames;
children?(props: ChildrenProps<TObject>): JSX.Element;
fallbackComponent?(props: RenderProps): JSX.Element;
fallbackComponent?(props: Renderer): JSX.Element;
headerComponent?(props: HeaderComponentProps<TObject>): JSX.Element;
status: RecommendStatus;
translations?: RecommendTranslations;
Expand Down

0 comments on commit bcfa781

Please sign in to comment.