React-360: Easing can only be imported from React Native

Created on 21 Jun 2017  路  2Comments  路  Source: facebookarchive/react-360

Description

I attempted to import _Easing_ which is specified as a React VR API like so:

~
import {
Text,
View,
Animated,
Easing
} from 'react-vr';
~

Expected behavior

Since Text, View, and Image are found in React Native and React VR but imported from _react_vr_, one would expect to be able to import _Easing_ from react-vr.

Actual behavior

Easing came up as undefined when importing from react-vr.

Solution

The only solution was to import Easing from _react_native_:

import { Easing } from 'react-native';

Most helpful comment

The problem is this is never mentioned anywhere, so it is quite confusing, because the docs do not distinguish between Animated and Easing (they are both in API section). Should there be React VR APIs and APIs sections, each documented with the correct way to use the modules?

All 2 comments

The versions of Text, View, Animated, etc that we provide on React VR are different from their React Native implementations. For things like Easing that are the same in RN, we don't proxy them over to the react-vr package. It'd be too much effort to copy over every export of RN, and update it on each new release (they're lazy-loaded, so we can't just do it automatically with a spread operator or something). I'd classify this as expected behavior.

The problem is this is never mentioned anywhere, so it is quite confusing, because the docs do not distinguish between Animated and Easing (they are both in API section). Should there be React VR APIs and APIs sections, each documented with the correct way to use the modules?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikgraf picture nikgraf  路  3Comments

stu60610 picture stu60610  路  4Comments

wuno picture wuno  路  3Comments

baloo887 picture baloo887  路  3Comments

jordanpapaleo picture jordanpapaleo  路  3Comments