Skip to content

Instantly share code, notes, and snippets.

@yestoall
Last active December 3, 2024 11:01
Show Gist options
  • Save yestoall/eafa1170dac7da7541051809bec724b1 to your computer and use it in GitHub Desktop.
Save yestoall/eafa1170dac7da7541051809bec724b1 to your computer and use it in GitHub Desktop.
templates
//· <AnimatePresence> ·
"use client"
import { AnimatePresence, motion } from "framer-motion"
const opened = true
// ...
const render = () => {
return (
<AnimatePresence>
{opened && (
<motion.div
initial={{ height: 0 }}
animate={{ height: "200px" }}
exit={{ height: 0 }}
transition={{ duration: 0.2, ease: "easeIn" }}
>
<p>Content</p>
</motion.div>
)}
</AnimatePresence>
)
}
"use client"
import { useState } from "react"
import { cn } from "@/utils/cn"
interface Props {
children: React.ReactNode
}
//· Component ·
export const Component = ({ children }: Props) => {
return { children }
}
//· EXPO haptics ·
import * as Haptics from "expo-haptics"
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)
//· translate ·
import { useTranslation } from "react-i18next"
/* --- */
const { t } = useTranslation()
// <Text>{t("hello")}</Text>
// t("hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment