Skip to content

Instantly share code, notes, and snippets.

View mwinel's full-sized avatar
💻
let us build sth together

Nelson M mwinel

💻
let us build sth together
View GitHub Profile
@mwinel
mwinel / autocomplete-input.tsx
Last active June 19, 2024 06:42
This gist implements a Trie (prefix tree) structure and integrates it into a React component to provide autocomplete functionality. The Trie structure efficiently stores and retrieves words, making it ideal for autocomplete and search applications. The React component uses the Trie to suggest completions for user input in real time.
'use client';
import React from 'react';
import { cn } from './utils';
export type AutocompleteInputProps =
React.InputHTMLAttributes<HTMLInputElement> & {
suggestion: string;
};
// install nodemailer
// install formik
import React from 'react';
import { useFormik } from 'formik';
const ContactForm = () => {
const formik = useFormik({
initialValues: {
name: '',