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
Install dependencies
Run
yarn from the root. This installs dependencies for both the library and the example app via Yarn workspaces.Development workflow
Available commands
| Command | Description |
|---|---|
yarn example start | Start Metro bundler for the example app |
yarn example ios | Build and run the example app on iOS |
yarn example android | Build and run the example app on Android |
yarn test | Run Jest tests |
yarn lint | Run ESLint and TypeScript type check |
yarn format:write | Auto-fix Prettier and clang-format issues |
yarn typecheck | TypeScript type check only |
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:
Add codegen props
Add
animateMyNewProp and initialAnimateMyNewProp to src/EaseViewNativeComponent.ts. This is the codegen spec — the native side reads these flat props.Add identity default
Add the identity (neutral) value to
IDENTITY in src/EaseView.tsx and pass both flat props to NativeEaseView.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.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.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.Commit style
Use conventional commits:| Prefix | When to use |
|---|---|
feat: | New animatable property, new feature |
fix: | Bug fix |
chore: | Tooling, dependencies, build changes |
docs: | Documentation changes only |
test: | Adding or updating tests |
refactor: | Code change with no behavior change |
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