Comments (4)
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.
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';
Withimport 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.
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.
@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)
- horizontalview layout issues HOT 5
- question about reanimated v3 HOT 3
- Cant add react-native-video-cache to project. HOT 2
- unable to import into node_modules HOT 9
- change the default values of the useState variables HOT 4
- Video duration don't change HOT 3
- Display avatars vertically HOT 1
- Wrap FlatList of storyavatar HOT 1
- hide seen stories to the left HOT 2
- how to render a component HOT 2
- How to modify the progress bar of multistory screen HOT 2
- The package 'react-native-video-cache-control' doesn't seem to be linked HOT 3
- Every thing hides and also stops when we click on send message footer HOT 1
- Types mismatching HOT 1
- getting error when clicking on a story. "Cannot add new property __reanimatedHostObjectRef" HOT 3
- When Send message keyboad is open send button not work HOT 2
- MultiStory pause not working HOT 1
- The package 'react-native-video-cache-control' doesn't seem to be linked HOT 1
- Custom View Cannot Click (No response when Click CustomView) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-story-view.