Comments (12)
I hate it when property is not configurable
from react-native-reanimated.
@piaskowyk can you please take a look into this? (tagging you since you fixed the similar linked issue).
It happens with runOnJS
too, eg:
const [showPlayButton, setShowPlayButton] = useState(!user?.gif_autoplay);
const [currentIndex, setCurrentIndex] = useState(0);
const selectedPageHandler = useAnimatedPagerSelectedPageHandler({
onPageSelected: (e) => {
"worklet";
currentPage.value = e.position;
runOnJS(setShowPlayButton)(!user?.gif_autoplay);
runOnJS(setCurrentIndex)(e.position);
}
});
This line will throw: tsx runOnJS(setShowPlayButton)(!user?.gif_autoplay);
while the next line won't.
from react-native-reanimated.
I've just released an rc1 version of Reanimated (3.13.0-rc.1) that should solve this issue. Please check if it works for you.
from react-native-reanimated.
Thanks @tjzel! Been using
if (descriptor && !descriptor.configurable) {
return;
}
from comment above since I posted the comment and no issues so far so 3.13.0-rc.1 should be fine!
from react-native-reanimated.
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
from react-native-reanimated.
I have the same problem since 3.12.0 version.
To reproduce this error, just call a variable from StyleSheet.create
to set a property value in useAnimatedStyle
hook. Like this:
export const useStyles = () => {
const styles = StyleSheet.create({
container: {
marginTop: 16
} as ViewStyle,
})
return styles
}
export default useStyles
const animatedStyle = useAnimatedStyle(() => ({
marginTop: styles.container.marginTop,
opacity: interpolate(
scrollOffsetY.value,
[0, TOP_SCROLL_DISTANCE],
[0, 1],
Extrapolation.CLAMP,
),
}))
@szydlovsky Did you see this issue before releasing 3.12.0 version?
from react-native-reanimated.
I also encounter the same problem after upgrading from 3.11.x to 3.12.0.
For me it happened when I try to call a function exposed by a component via its ref, using React.createRef
.
Modal.tsx
export const ModalRef = createRef()
export const Modal = props => {
return <ModalComponent ref={BottomTabBarRef} {...props} />
};
App.tsx
<>
<Child />
<Modal />
</>
Child.tsx
useAnimatedReaction(
() => ({...}),
({ ... }) => {
runOnJS(ModalRef.current.show)() // <-- Works fine before upgrading to 3.12.0
}
);
from react-native-reanimated.
I also experienced this while trying to use StyleSheet.hairlineWidth
within useAnimatedStyle
. One thing to note is that it did not need to actually be called to crash, only to be somewhere in the code in the worklet. A temporary workaround for me was to define const hairlineWidth = StyleSheet.hairlineWidth;
outside of the worklet, and then use that value in the worklet, so I'd assume this would work for StyleSheet.absoluteFillObject
.
from react-native-reanimated.
Encountered same issue with 3.12.0.
Minimal snippet to reproduce error:
const animatedSwitchKnob = useAnimatedStyle(() => {
const [offsetLeft, offsetRight] = [
styles.inner.paddingStart,
styles.inner.paddingEnd,
];
<...>
}, [activated]);
const styles = StyleSheet.create({
inner: {
paddingStart: 4,
paddingEnd: 4,
},
});
from react-native-reanimated.
@tjzel @kmagiera sorry for breaking balls about this issue, is someone looking into it? It's impossible to work 😓
I could downgrade to 3.11.x but why should I? haha
from react-native-reanimated.
Patch package that fixed a similar issue: #6082 (comment)
from react-native-reanimated.
I think we should check if the property is configurable on shareables.ts
freezeObjectIfDev
function:
react-native-reanimated/src/reanimated2/shareables.ts
Lines 320 to 321 in 8a9e161
Object.entries(value).forEach(([key, element]) => {
const descriptor = Object.getOwnPropertyDescriptor(value, key);
if (descriptor && !descriptor.configurable) {
return;
}
...
from react-native-reanimated.
Related Issues (20)
- iOS build faied: ld: Undefined symbols HOT 3
- SVG Polygon Animation not working HOT 1
- useSharedValue `modify` does not exist, but shows in docs HOT 1
- Animated component issue: touchables and TextInputs inside the Animated.ScrollView are not responsive HOT 3
- web: AnimatedComponent raises a deprecation warning for findDOMNode in v3.12.0 HOT 4
- React Native Reanimated Not Responsive HOT 5
- Invalid `RNReanimated.podspec` file: [Reanimated] Unsupported React Native version. Please use 0.71 or newer. HOT 3
- Android build failure v3.12.0 HOT 12
- Impossible to animate any SVG color on android HOT 5
- 3.12.0 crashes with 'property is not configurable' HOT 11
- Performance regression or race condition between UI and JS threads
- RangeError: Set maximum size exceeded HOT 3
- com.facebook.react.uimanager.IllegalViewOperationException: Trying to resolve view with tag 2133 which doesn't exist HOT 9
- 3.13.0-rc.0 crash on iOS (animated flatlist) in Release build only HOT 4
- withRepeat is flickering on android HOT 4
- TypeError: null is not an object (evaluating '_ReanimatedModule.default.createNode') HOT 1
- glitches and crashes after migrating to reanimated >= 3.9 HOT 4
- Reanimated Crashes in Expo SDK 51.0.11 | "TypeError: animatedRef.getTag is not a function (it is undefined)" HOT 3
- App crash: `hermes::vm::HadesGC::EvacAcceptor<false>::acceptNullable(hermes::vm::PinnedHermesValue&) ()` HOT 9
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-reanimated.