Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions scripts/__snapshots__/e2e-templates.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3761,6 +3761,7 @@ exports[`Templates React InstantSearch File content: src/App.css 1`] = `

exports[`Templates React InstantSearch File content: src/App.js 1`] = `
"import React, { Component } from 'react';
import algoliasearch from 'algoliasearch/lite';
import {
InstantSearch,
Hits,
Expand All @@ -3772,6 +3773,11 @@ import {
import PropTypes from 'prop-types';
import './App.css';

const searchClient = algoliasearch(
'appId',
'apiKey'
);

class App extends Component {
render() {
return (
Expand All @@ -3789,11 +3795,7 @@ class App extends Component {
</header>

<div className=\\"container\\">
<InstantSearch
appId=\\"appId\\"
apiKey=\\"apiKey\\"
indexName=\\"indexName\\"
>
<InstantSearch searchClient={searchClient} indexName=\\"indexName\\">
<div className=\\"search-panel\\">
<div className=\\"search-panel__filters\\">
<RefinementList attribute=\\"facet1\\" />
Expand Down
1 change: 1 addition & 0 deletions src/templates/React InstantSearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint:fix": "npm run lint -- --fix"
},
"dependencies": {
"algoliasearch": "3.29.0",
"react": "16.4.1",
"react-dom": "16.4.1",
"react-instantsearch-dom": "{{libraryVersion}}",
Expand Down
12 changes: 7 additions & 5 deletions src/templates/React InstantSearch/src/App.js.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import algoliasearch from 'algoliasearch/lite';
import {
InstantSearch,
Hits,
Expand All @@ -14,6 +15,11 @@ import {
import PropTypes from 'prop-types';
import './App.css';

const searchClient = algoliasearch(
'{{appId}}',
'{{apiKey}}'
);

class App extends Component {
render() {
return (
Expand All @@ -31,11 +37,7 @@ class App extends Component {
</header>

<div className="container">
<InstantSearch
appId="{{appId}}"
apiKey="{{apiKey}}"
indexName="{{indexName}}"
>
<InstantSearch searchClient={searchClient} indexName="{{indexName}}">
<div className="search-panel">
{{#if attributesForFaceting}}
<div className="search-panel__filters">
Expand Down