Git Product home page Git Product logo

Comments (4)

mtalhadev avatar mtalhadev commented on May 23, 2024 5

You can resolve this error by applying a patch:

Navigate to:
/node_modules/react-native-story-view/lib/components/MultiStoryContainer/MultiStoryContainer.js

Change line 4:
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
With
import Animated, { useAnimatedStyle, runOnJS } from 'react-native-reanimated';

Then from line 21 to line 30:

    const animationStyle = useAnimatedStyle(() => {
        switch (props.transitionMode) {
            case TransitionMode.Cube:
                return cubeTransition(index, scrollX);
            case TransitionMode.Scale:
                return scaleTransition(index, scrollX);
            default:
                return defaultTransition();
        }
    }, [index, scrollX.value]);

With:

    const animationStyle = useAnimatedStyle(() => {
        switch (props.transitionMode) {
            case TransitionMode.Cube:
                return runOnJS(cubeTransition)(index, scrollX);
            case TransitionMode.Scale:
                return runOnJS(scaleTransition)(index, scrollX);
            default:
                return runOnJS(defaultTransition)();
        }
    }, [index, scrollX.value]);

from react-native-story-view.

ridvanaltun avatar ridvanaltun commented on May 23, 2024

You can resolve this error by applying a patch:

Navigate to: /node_modules/react-native-story-view/lib/components/MultiStoryContainer/MultiStoryContainer.js

Change line 4: import Animated, { useAnimatedStyle } from 'react-native-reanimated'; With import Animated, { useAnimatedStyle, runOnJS } from 'react-native-reanimated';

Then from line 21 to line 30:

    const animationStyle = useAnimatedStyle(() => {
        switch (props.transitionMode) {
            case TransitionMode.Cube:
                return cubeTransition(index, scrollX);
            case TransitionMode.Scale:
                return scaleTransition(index, scrollX);
            default:
                return defaultTransition();
        }
    }, [index, scrollX.value]);

With:

    const animationStyle = useAnimatedStyle(() => {
        switch (props.transitionMode) {
            case TransitionMode.Cube:
                return runOnJS(cubeTransition)(index, scrollX);
            case TransitionMode.Scale:
                return runOnJS(scaleTransition)(index, scrollX);
            default:
                return runOnJS(defaultTransition)();
        }
    }, [index, scrollX.value]);

This is not working with react-native-reanimated version 3.4.1. However 3.3.0 works without problem.

from react-native-story-view.

aawolf1099 avatar aawolf1099 commented on May 23, 2024

Navigate to: /node_modules/react-native-story-view/lib/components/MultiStoryContainer/utils/StoryTransitions.js

Replace this code:

export const defaultTransition = () => ({ ...StyleSheet.absoluteFillObject });

with this code:

export const defaultTransition = () => {
    'worklet';
    return {
        ...StyleSheet.absoluteFillObject,
    };
};


from react-native-story-view.

dhruv-h-simform avatar dhruv-h-simform commented on May 23, 2024

@iArchin This issue is fixed.
Thank you for your PR @aawolf1099.

This change will be available in the next release.

from react-native-story-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.