Skip to content

Instantly share code, notes, and snippets.

View officialrajdeepsingh's full-sized avatar

Rajdeep Singh officialrajdeepsingh

View GitHub Profile
@officialrajdeepsingh
officialrajdeepsingh / Search.tsx
Created April 16, 2023 09:23
Creating search functionality on static blog with next js, markdown and flexsearch
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({}));