Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shared): make usable when there's no preact or react #13

Merged
merged 4 commits into from
Oct 10, 2022

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Oct 10, 2022

packages/shared/src/Renderer.ts Outdated Show resolved Hide resolved
@Haroenv
Copy link
Contributor Author

Haroenv commented Oct 10, 2022

I've tried this out in Angular InstantSearch, and while it solves most of the issue, ComponentProps didn't work properly yet, experimenting a little further

Error: node_modules/@algolia/ui-components-highlight-vdom/dist/esm/Highlight.d.ts:24:53 - error TS2344: Type 'string' does not satisfy the constraint 'never'.

24 export declare type HighlightProps = ComponentProps<'span'> & {
                                                       ~~~~~~
node_modules/@algolia/ui-components-highlight-vdom/dist/esm/Highlight.d.ts:31:155 - error TS2339: Property 'className' does not exist on type '{ classNames?: Partial<HighlightClassNames>; highlightedTagName?: FunctionComponent<any>; nonHighlightedTagName?: FunctionComponent<any>; separator?: ComponentChildren; parts: HighlightedPart[][]; }'.

31 export declare function createHighlightComponent({ createElement, Fragment, }: Renderer): ({ parts, highlightedTagName, nonHighlightedTagName, separator, className, classNames, ...props }: HighlightProps) => JSX.Element;
                                                                                                                                                             ~~~~~~~~~

that error shows up because in Angular InstantSearch there's no @types/react, I wonder what the effect would be if it was a regular dependency (do things still override with preact? I don't think so)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants