-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
Description
The first component we display calls setBoolean on mount:
useEffect(() => {
riveRef.current?.setBoolean('isFocused', isFocused);
}, [isFocused]);
This causes the app to crash on iOS here:
| let component = self.bridge.uiManager.view(forReactTag: node) as! RiveReactNativeView |
rive_react_native/RiveReactNativeViewManager.swift:116: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Provide a Repro
export default function InitialComponent() {
const [isFocused, setIsFocused] = useState(false);
const riveRef = useRef<RiveRef>(null);
useEffect(() => {
riveRef.current?.setBoolean('isFocused', isFocused);
}, [isFocused]);
return (
<Rive
url="<somethign from the internet>"
autoplay
fit={Fit.Cover}
style={StyleSheet.absoluteFillObject}
ref={riveRef}
dataBinding={AutoBind(true)}
/>
);
}
Source .riv/.rev file
Not animation-specific
Expected behavior
The app should not crash
Screenshots
Not applicable
Device & Versions (please complete the following information)
- Device: iPhone 17 Pro
- OS: iOS 26.0.1
- NPM Version: 10.9.3