Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
feat(templates): update react instantsearch web templates to react 18 (
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab authored Aug 1, 2022
1 parent dcda939 commit 25f170f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
16 changes: 10 additions & 6 deletions e2e/__snapshots__/templates.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5821,11 +5821,11 @@ body {

exports[`Templates React InstantSearch File content: src/index.js 1`] = `
"import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));"
createRoot(document.getElementById('root')).render(<App />);"
`;

exports[`Templates React InstantSearch Folder structure: contains the right files 1`] = `
Expand Down Expand Up @@ -6037,7 +6037,8 @@ em {
`;
exports[`Templates React InstantSearch Hooks File content: src/App.tsx 1`] = `
"import algoliasearch from 'algoliasearch/lite';
"import React from 'react';
import algoliasearch from 'algoliasearch/lite';
import {
Configure,
DynamicWidgets,
Expand Down Expand Up @@ -6124,7 +6125,9 @@ function Hit({ hit }: HitProps) {
`;
exports[`Templates React InstantSearch Hooks File content: src/Panel.tsx 1`] = `
"type PanelProps = React.PropsWithChildren<{
"import React from 'react';
type PanelProps = React.PropsWithChildren<{
header: string;
}>;
Expand All @@ -6141,11 +6144,12 @@ export function Panel({ header, children }: PanelProps) {
`;
exports[`Templates React InstantSearch Hooks File content: src/index.tsx 1`] = `
"import ReactDOM from 'react-dom';
"import React from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './App';
ReactDOM.render(<App />, document.getElementById('root'));"
createRoot(document.getElementById('root')!).render(<App />);"
`;
exports[`Templates React InstantSearch Hooks Folder structure: contains the right files 1`] = `
Expand Down
12 changes: 7 additions & 5 deletions src/templates/React InstantSearch Hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
},
"dependencies": {
"algoliasearch": "4",
"instantsearch.js": "4.40.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"instantsearch.js": "4.43.1",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-instantsearch-hooks-web": "{{libraryVersion}}"
},
"devDependencies": {
"@types/react": "17.0.45",
"parcel": "2.5.0"
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"parcel": "2.5.0",
"typescript": "4.7.4"
}
}
1 change: 1 addition & 0 deletions src/templates/React InstantSearch Hooks/src/App.tsx.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import algoliasearch from 'algoliasearch/lite';
import {
Configure,
Expand Down
2 changes: 2 additions & 0 deletions src/templates/React InstantSearch Hooks/src/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react';

type PanelProps = React.PropsWithChildren<{
header: string;
}>;
Expand Down
5 changes: 3 additions & 2 deletions src/templates/React InstantSearch Hooks/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { createRoot } from 'react-dom/client';

import { App } from './App';

ReactDOM.render(<App />, document.getElementById('root'));
createRoot(document.getElementById('root')!).render(<App />);
4 changes: 2 additions & 2 deletions src/templates/React InstantSearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
},
"dependencies": {
"algoliasearch": "4",
"react": "16.12.0",
"react-dom": "16.12.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-instantsearch-dom": "{{libraryVersion}}",
"react-scripts": "2.1.1"
},
Expand Down
4 changes: 2 additions & 2 deletions src/templates/React InstantSearch/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
createRoot(document.getElementById('root')).render(<App />);

0 comments on commit 25f170f

Please sign in to comment.