Skip to content

feat: add className prop to EaseView component and corresponding test#11

Merged
janicduplessis merged 1 commit intomainfrom
feat/classname
Mar 21, 2026
Merged

feat: add className prop to EaseView component and corresponding test#11
janicduplessis merged 1 commit intomainfrom
feat/classname

Conversation

@EQuimper
Copy link
Member

Summary

Added className prop to EaseView for NativeWind compatibility.

What changed

src/EaseView.tsx — Added className?: string to EaseViewProps. Since className is not destructured, it flows through {...rest} to the native view automatically. NativeWind's babel transform intercepts it before it reaches native.

src/__tests__/EaseView.test.tsx — Added test verifying className is forwarded as a prop.

How it works

Users with NativeWind in their project can now use Tailwind classes on EaseView:

<EaseView
  className="w-24 h-24 rounded-2xl bg-indigo-500"
  animate={{ scale: pressed ? 1.2 : 1 }}
  transition={{ type: 'spring', damping: 12 }}
/>

NativeWind's babel plugin transforms className into a style prop at build time — EaseView just needs to accept and forward it.

@EQuimper EQuimper requested a review from janicduplessis March 20, 2026 17:20
@janicduplessis janicduplessis merged commit 409a70f into main Mar 21, 2026
4 checks passed
@janicduplessis janicduplessis deleted the feat/classname branch March 21, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants