question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Passed properties: {"translateY":0"extrapolate":"clamp"}

See original GitHub issue

Hello, I am trying to run the simple Usage example on the first page, but I got this error: You must specify exactly one property per transform object. Passed properties: {“translateY”:0"extrapolate":“clamp”}

I got this error when I tried to run the full example too. And I just can’t seem to resolve it.

If you have time please assist me ! Version: react-native-cli: 2.0.1 react-native: 0.42.3 Code:

import React from 'react';
import {
  Text
} from 'react-native';

import Parallax from 'react-native-parallax';

const Example = React.createClass({
    render() {
    return (
      <Parallax.ScrollView>
        <Parallax.Image
          style={{ height: 200 }}
          overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.3)'}}
          source={require('../assets/mainImages/2.png')}
        >
          <Text>This is optional overlay content</Text>
        </Parallax.Image>
      </Parallax.ScrollView>
    );
  },
});
Export default Example;

Thank you !

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
mgolkardevcommented, Jul 31, 2017

Hi

Please comment extrapolate: 'clamp' in \node_modules\react-native-parallax\ParallaxImage.js line 94 or Move extrapolate to scrollY.interpolate like this

          translateY:   scrollY.interpolate({
            inputRange:   [offset - height, offset + WINDOW_HEIGHT + height],
            outputRange:  [-parallaxPadding, parallaxPadding],
            extrapolate:  'clamp',
          }),

Your problem will be resolved.

2reactions
pxuecommented, Apr 8, 2017

I just upgraded from 0.41.1, So I’m not sure about 0.42. I’ve forked and fixed it here: https://github.com/pxue/react-native-parallax Feel free to point your package.json to it for now. I’ll submit a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interpolation with React Native Animations | by evening kid
So if we clamp our extrapolation on the left side, this means that any value for translation below 25 will stay at 0....
Read more >
Using the Animated API correctly in react native - Stack Overflow
I.e. it should be e.g. { inputRange: [0, 1], outputRange: [0, -120], extrapolate: 'clamp' } . Suggested edit queue is full so I...
Read more >
Animations - React Native
By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value. A basic...
Read more >
Interpolate with ScrollView like a pro (React Native ... - YouTube
In this tutorial we'll unleash the power of the interpolate function from the Reanimated package. In order to do that, we are going...
Read more >
Reanimated 2 - the new approach to creating animations in ...
There is a problem with our slider. We can move the knob beyond our slider. Let's fix that by adding the clamp function,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found