velocity-react provides a set of React components designed to integrate the Velocity.js DOM animation library into React applications. Key components include `VelocityComponent` for animating a single child, and `VelocityTransitionGroup` for managing animations during component mounting, unmounting, and updates. The current stable version is v1.4.3, released in May 2019. This package acts as a bridge, allowing React developers to leverage Velocity.js's performance and declarative API within their component-based UIs, contrasting with CSS-based animations or other JavaScript animation libraries by providing a more direct imperative control over DOM animations through React props. Its release cadence has been very slow, with no updates since 2019, strongly suggesting it is no longer actively maintained.
npm install velocity-reactVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic `VelocityComponent` animating a box's opacity and horizontal position based on a state change, including explicit Velocity.js loading instructions for proper function.
For new projects or applications requiring modern React compatibility, consider migrating to actively maintained animation libraries such as Framer Motion, React Spring, or directly utilizing CSS-in-JS solutions or CSS animations.
These warnings primarily stem from an upstream dependency (`react-transition-group` v2). There is no direct fix within `velocity-react` itself due to its unmaintained status. Developers may choose to tolerate these warnings in `StrictMode` or explore alternative animation libraries.
Ensure `require('velocity-animate');` and, if using UI effects, `require('velocity-animate/velocity.ui');` are placed at the top level of your main application file (e.g., `App.js` or `index.js`). Depending on your bundler configuration, you might also need to explicitly list `velocity-animate` in `package.json` dependencies to resolve `velocity-animate/velocity.ui` correctly.Prefer animating the direct child of `VelocityComponent` where possible. If `targetQuerySelector` is essential, use it with thorough testing and be mindful that React's reconciliation may not preserve the targeted nodes' state as expected during animations.
Add `require('velocity-animate');` at an entry point of your application, ensuring it executes before any `velocity-react` components are mounted. If using the UI pack, also add `require('velocity-animate/velocity.ui');`.This is an upstream warning from `react-transition-group` v2 and is difficult to resolve directly within an unmaintained `velocity-react` project. You may choose to tolerate the warning or consider migrating to a modern animation library that fully supports newer React lifecycle methods.
Ensure `velocity-animate` is explicitly listed in your `package.json` dependencies. Try running `npm dedupe` or `yarn install --force` to resolve potential duplicate `velocity-animate` installations. Verify that `require('velocity-animate');` is called *before* `require('velocity-animate/velocity.ui');`.