This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from "react"; | |
import { Index } from "flexsearch"; | |
import { posts } from "./posts"; | |
export default () => { | |
// This will create a new search index. Here we are using all of the default options, but the docs show other choices that can be used. | |
const [index, setIndex] = useState(new Index({})); |