This repository was archived by the owner on Dec 16, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
src/templates/React InstantSearch Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -3761,6 +3761,7 @@ exports[`Templates React InstantSearch File content: src/App.css 1`] = `
37613761
37623762exports[`Templates React InstantSearch File content: src/App.js 1`] = `
37633763" import React, { Component } from 'react';
3764+ import algoliasearch from 'algoliasearch/lite';
37643765import {
37653766 InstantSearch,
37663767 Hits,
@@ -3772,6 +3773,11 @@ import {
37723773import PropTypes from 'prop-types';
37733774import './App.css';
37743775
3776+ const searchClient = algoliasearch(
3777+ 'appId',
3778+ 'apiKey'
3779+ );
3780+
37753781class App extends Component {
37763782 render() {
37773783 return (
@@ -3789,11 +3795,7 @@ class App extends Component {
37893795 </header>
37903796
37913797 <div className=\\"container\\">
3792- <InstantSearch
3793- appId=\\"appId\\"
3794- apiKey=\\"apiKey\\"
3795- indexName=\\"indexName\\"
3796- >
3798+ <InstantSearch searchClient={searchClient} indexName=\\"indexName\\">
37973799 <div className=\\"search-panel\\">
37983800 <div className=\\"search-panel__filters\\">
37993801 <RefinementList attribute=\\"facet1\\" />
Original file line number Diff line number Diff line change 99 "lint:fix" : " npm run lint -- --fix"
1010 },
1111 "dependencies" : {
12+ "algoliasearch" : " 3.29.0" ,
1213 "react" : " 16.4.1" ,
1314 "react-dom" : " 16.4.1" ,
1415 "react-instantsearch-dom" : " {{libraryVersion}}" ,
Original file line number Diff line number Diff line change 11import React, { Component } from 'react';
2+ import algoliasearch from 'algoliasearch/lite';
23import {
34 InstantSearch,
45 Hits,
@@ -14,6 +15,11 @@ import {
1415import PropTypes from 'prop-types';
1516import './App.css';
1617
18+ const searchClient = algoliasearch(
19+ '{{ appId }} ',
20+ '{{ apiKey }} '
21+ );
22+
1723class App extends Component {
1824 render() {
1925 return (
@@ -31,11 +37,7 @@ class App extends Component {
3137 </header >
3238
3339 <div className =" container" >
34- <InstantSearch
35- appId =" {{ appId }} "
36- apiKey =" {{ apiKey }} "
37- indexName =" {{ indexName }} "
38- >
40+ <InstantSearch searchClient = {searchClient} indexName =" {{ indexName }} " >
3941 <div className =" search-panel" >
4042 {{ #if attributesForFaceting }}
4143 <div className =" search-panel__filters" >
You can’t perform that action at this time.
0 commit comments