mirror of
https://github.com/rive-app/rive-react.git
synced 2025-12-19 01:30:08 +08:00
chore: simplify useViewModel
This commit is contained in:
@@ -43,12 +43,9 @@ export default function useViewModel(params: UseViewModelParameters): ViewModel
|
||||
const areParamsChanged = !areParamsEqual(paramsRef.current, params);
|
||||
|
||||
shouldUpdate.current = isRiveChanged || areParamsChanged;
|
||||
|
||||
riveRef.current = rive;
|
||||
paramsRef.current = params;
|
||||
}, [rive, name, useDefault]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!shouldUpdate.current && viewModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user