Skip to content

Commit 77599c6

Browse files
feat: compatibility with React 19 types (#1299)
1 parent eb18401 commit 77599c6

File tree

16 files changed

+36
-63
lines changed

16 files changed

+36
-63
lines changed

examples/react-17/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
},
2020
"devDependencies": {
2121
"@algolia/client-search": "4.16.0",
22-
"@types/react": "^17.0.0",
23-
"@types/react-dom": "^17.0.0",
22+
"@types/react": "^19.0.7",
23+
"@types/react-dom": "^19.0.3",
2424
"@vitejs/plugin-react": "1.0.7",
2525
"typescript": "^4.4.2",
2626
"vite": "2.8.0"

examples/react-17/src/Highlight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
2-
import { createElement, Fragment } from 'react';
2+
import { createElement, Fragment, JSX } from 'react';
33

44
type HighlightHitParams<THit> = {
55
/**

examples/react-instantsearch/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"react-instantsearch": "7.12.1"
2121
},
2222
"devDependencies": {
23-
"@types/react": "^18.0.26",
24-
"@types/react-dom": "^18.0.9",
23+
"@types/react": "^19.0.7",
24+
"@types/react-dom": "^19.0.3",
2525
"@vitejs/plugin-react": "1.0.7",
2626
"typescript": "4.5.4",
2727
"vite": "2.8.0"

examples/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
},
2020
"devDependencies": {
2121
"@algolia/client-search": "4.16.0",
22-
"@types/react": "^18.0.26",
23-
"@types/react-dom": "^18.0.9",
22+
"@types/react": "^19.0.7",
23+
"@types/react-dom": "^19.0.3",
2424
"@vitejs/plugin-react": "1.0.7",
2525
"typescript": "^4.4.2",
2626
"vite": "2.8.0"

examples/slack-with-emojis-and-commands/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"devDependencies": {
2222
"@algolia/client-search": "4.16.0",
23-
"@types/react": "^17.0.0",
24-
"@types/react-dom": "^17.0.0",
23+
"@types/react": "^19.0.7",
24+
"@types/react-dom": "^19.0.3",
2525
"@types/textarea-caret": "3.0.1",
2626
"@vitejs/plugin-react": "1.0.7",
2727
"typescript": "^4.4.2",

examples/slack-with-emojis-and-commands/src/types/Command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { JSX } from 'react';
2+
13
export type Command = {
24
slug: string;
35
commands: string[];

examples/twitter-compose-with-typeahead/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
"devDependencies": {
2222
"@algolia/client-search": "4.16.0",
23-
"@types/react": "^17.0.0",
24-
"@types/react-dom": "^17.0.0",
23+
"@types/react": "^19.0.7",
24+
"@types/react-dom": "^19.0.3",
2525
"@types/textarea-caret": "3.0.1",
2626
"@vitejs/plugin-react": "1.0.7",
2727
"typescript": "^4.4.2",

examples/two-column-layout/src/components/Breadcrumb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { intersperse } from '../utils';
77
import { ChevronRightIcon } from './Icons';
88

99
type BreadcrumbProps = {
10-
items: JSX.Element[];
10+
items: h.JSX.Element[];
1111
};
1212

1313
export function Breadcrumb({ items }: BreadcrumbProps) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"@testing-library/user-event": "12.5.0",
4141
"@types/jest": "^26.0.16",
4242
"@types/jest-diff": "^24.3.0",
43-
"@types/react": "^17.0.0",
44-
"@types/react-dom": "^17.0.0",
43+
"@types/react": "^19.0.7",
44+
"@types/react-dom": "^19.0.3",
4545
"@typescript-eslint/eslint-plugin": "2.34.0",
4646
"@typescript-eslint/parser": "2.34.0",
4747
"algoliasearch": "4.16.0",

packages/autocomplete-js/src/components/Highlight.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
22

3-
import { AutocompleteRenderer, HighlightHitParams } from '../types';
3+
import { AutocompleteRenderer, HighlightHitParams, VNode } from '../types';
44

55
export function createHighlightComponent({
66
createElement,
@@ -10,7 +10,7 @@ export function createHighlightComponent({
1010
hit,
1111
attribute,
1212
tagName = 'mark',
13-
}: HighlightHitParams<THit>): JSX.Element {
13+
}: HighlightHitParams<THit>): VNode<any> {
1414
return createElement(
1515
Fragment,
1616
{},

0 commit comments

Comments
 (0)