Registry / testing / motion-react

motion-react

JSON →
library0.15.0-alpha.1jsnpmunverified

An experimental fork/framework based on React 0.15.0-alpha.1 enabling motion-UI primitives and animation-driven components. This is an unreleased alpha build of React (v0.15.0-alpha.1) with 'reactive-motion' capabilities. Not fit for production; intended for prototyping animation patterns. The main difference from standard React is the inclusion of motion primitives in the core.

npm install motion-react
INSTALL
IMPORT
SIG · MOTION-REACT
M
motion-react
testingjavascriptv0.15.0-alpha.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import React from 'motion-react'
import * as React from 'motion-react'
React is the default export; wildcard import will not work as expected.
Component
import React, { Component } from 'motion-react'
Named export Component is available alongside default.
Motion
import { Motion, spring } from 'motion-react'
import { Motion } from 'react-motion'
Motion primitive is included in this package, not react-motion.
require
const React = require('motion-react')
var React = require('react')
CommonJS require must use package name 'motion-react'.

Shows basic use of built-in Motion primitive for animations, rendering an animated div.

import React, { Component, Motion, spring } from 'motion-react'; import { render } from 'react-dom'; class AnimatedDiv extends Component { render() { return ( <Motion defaultStyle={{ x: 0 }} style={{ x: spring(100) }}> {interpolating => <div style={{ transform: `translateX(${interpolating.x}px)` }} />} </Motion> ); } } render(<AnimatedDiv />, document.getElementById('root'));
Debug
Known issues
breakingThis package (motion-react) is a pre-release alpha fork. It is NOT compatible with standard React packages (react, react-dom).
fix
Do not mix with regular React packages. Use only motion-react for all React APIs.
affects: >=0.0.0
deprecatedThis version (0.15.0-alpha.1) is old and unmaintained. The motion primitives are not compatible with modern React.
fix
Migrate to a proper animation library (e.g., framer-motion) or use standard React with react-motion.
affects: >=0.15.0-alpha.1
gotchaUsing require('motion-react') in an ESM environment (module type in package.json) will cause a ReferenceError.
fix
Use import syntax in ESM contexts.
affects: >=0.15.0-alpha.1
gotchaThe spring function must be imported explicitly; it is not accessible as React.spring.
fix
import { spring } from 'motion-react';
affects: >=0.15.0-alpha.1
Errors
Common errors & fixes
Module not found: Can't resolve 'react'
Importing 'react' instead of 'motion-react'.
fix
Replace 'react' with 'motion-react' in imports.
Uncaught ReferenceError: require is not defined
Using CommonJS require in an ESM environment.
fix
Use import syntax or change module system.
TypeError: Cannot read properties of undefined (reading 'createElement')
Using wildcard import (import * as React) which breaks default export.
fix
Use import React from 'motion-react'.
Upgrade
Version history
0.15.0-alpha.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Resources
motion-react — npm install motion-react · libregistry