Prerequisites
- Node.js — check the
.nvmrcfile for the required version - Yarn — the project uses Yarn workspaces and cannot be set up with
npm
Project structure
The repository is a monorepo with two packages:Setup
1
Clone the repository
2
Install dependencies
Run
yarn from the root. This installs dependencies for both the library and the example app via Yarn workspaces.3
Run the example app
The example app is configured to use the local library source. Any changes to the TypeScript source are reflected immediately without a rebuild. Native code changes require rebuilding.
Development workflow
Available commands
Pre-commit checklist
Before committing, run the full check sequence:yarn format:write before yarn lint — this auto-fixes formatting issues that would otherwise show up as lint errors.
Lefthook pre-commit hooks run ESLint and TypeScript checks automatically on every commit. All failures must be fixed before the commit is accepted. If hooks aren’t running, install Lefthook:
yarn lefthook install.Editing native code
- iOS — Open
example/ios/EaseExample.xcworkspacein Xcode. Find the library source underPods > Development Pods > react-native-ease. - Android — Open
example/androidin Android Studio. Find the library source underreact-native-easein the Android panel.
Adding a new animatable property
Follow these steps when adding a new property toAnimateProps:
1
Add to types
Add the property to
AnimateProps in src/types.ts:2
Add codegen props
Add
animateMyNewProp and initialAnimateMyNewProp to src/EaseViewNativeComponent.ts. This is the codegen spec — the native side reads these flat props.3
Add identity default
Add the identity (neutral) value to
IDENTITY in src/EaseView.tsx and pass both flat props to NativeEaseView.4
Implement on iOS
In
ios/EaseView.mm, handle the new property in updateProps: — diff the old vs new value, read the current presentation layer value for smooth interruption, and create a CABasicAnimation or CASpringAnimation.5
Implement on Android
In
android/.../EaseViewManager.kt, add a @ReactProp setter. In EaseView.kt, add a pending field and handle it in applyAnimateValues() using ObjectAnimator or SpringAnimation.6
Handle view recycling
Reset the property to its identity value in
prepareForRecycle (iOS) and cleanup() (Android). Fabric recycles native views — any property not reset will leak stale values to the next component that uses the view.7
Add tests and documentation
- Add Jest tests in
src/__tests__/ - Add a demo in
example/src/App.tsxor a new screen - Update the
AnimatePropstable in the README
Commit style
Use conventional commits:Pull request guidelines
- Keep PRs focused on a single change
- Verify that linters and tests pass before opening
- For changes to the API or native implementation, open an issue first to discuss with maintainers
- Follow the pull request template when opening the PR
- Review any documentation that needs updating alongside your code change