Does anyone have an example of working with the search API with React or Gatsby?
1 Like
@escmattresscenter you can have a look at our public website
itβs slightly more complex as we are also searching through this community, but here is the page:
import React from 'react';
import { Wrap, button, Space } from 'blocks';
import ResponsiveSticky from 'components/ResponsiveSticky';
import DatoCmsSearch from 'datocms-search/dist/datocms-search.base';
import highlighter from 'keyword-highlighter';
import Link from 'components/Link';
import bem from 'utils/bem';
import '../components/DocAside/style.sass';
import Layout from 'components/Layout';
import Search from 'components/Search';
import './search.sass';
const client = new DatoCmsSearch('d46fe8134ea916b42af4eaa0d06109');
const b = bem.lock('DocPage');
const s = bem.lock('Search');
export default class BrandingPage extends React.Component {
state = {
docsResults: null,
This file has been truncated. show original
is that helpful?
1 Like
Did you figure out how to integrate the Dato Search into a Gatsby/React? I am struggling with that and the link to the repo provided is kind of confusing.