Files
nativewind/website/docs/api/use-tailwind.md
2022-05-23 18:22:00 +10:00

527 B

title, sidebar_label
title sidebar_label
useTailwind useTailwind()

Components can have multiple style props, or you may need programmatic access to the generated styles. In these instances you can use the useTailwind hook.

import { MotiView } from "moti";
import { useTailwind } from "tailwindcss-react-native";

export function MyComponent() {
  const tw = useTailwind();

  const opacity0 = tw("opacity-0");
  const opacity1 = tw("opacity-1");

  return <MotiView from={opacity0} animate={opacity1} exit={opacity0} />;
}