Last active
December 3, 2024 11:01
-
-
Save yestoall/eafa1170dac7da7541051809bec724b1 to your computer and use it in GitHub Desktop.
templates
This file contains 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
//· <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> | |
) | |
} |
This file contains 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
"use client" | |
import { useState } from "react" | |
import { cn } from "@/utils/cn" | |
interface Props { | |
children: React.ReactNode | |
} | |
//· Component · | |
export const Component = ({ children }: Props) => { | |
return { children } | |
} |
This file contains 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
//· EXPO haptics · | |
import * as Haptics from "expo-haptics" | |
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light) |
This file contains 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
//· 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