상세 컨텐츠

본문 제목

개발중인앱(1) react-native Animated vs react-native-reanimated

react-native

by RNDK 2024. 8. 30. 17:30

본문

"카핏"이라는 앱을 만들고있습니다.

소스코드를 공개할 수 없으나 제가 어떻게 만들고 어떤 라이브러리를 사용했는지 공유해드리고자 이글을 적기 시작합니다.
카핏이라는 앱에서는 모든 버튼에 눌리는 효과의 애니메이션이 들어갑니다.

react-native의 경우 Animated을 통해 애니메이션을 만들기도하지만
react-native-reanimated이라는 라이브러리를 통해 애니메이션으로 만드는 것이 인기이기도합니다.
reanimated을 사용하는 이유는 다양하지만 대표적인 이유는 다음과 같습니다.

1. UI 스레드에서 직접 실행되므로 JavaScript 스레드의 부하와 관계없이 일관된 성능을 보장합니다
2. 고급 애니메이션 인터랙션을 쉽게 구현할 있습니다
3. 복잡한 애니메이션 로직을 직관적이고 관리하기 쉬운 방식으로 작성할 있습니다

복잡하고 고급스러운 그래픽 엔진이 필요한 애니메이션을 그릴때에는 skia방식을 채택하기도 합니다.
https://github.com/Shopify/react-native-skia

 

GitHub - Shopify/react-native-skia: High-performance React Native Graphics using Skia

High-performance React Native Graphics using Skia. Contribute to Shopify/react-native-skia development by creating an account on GitHub.

github.com

하지만 복잡하지 않고 간단한 애니메이션이라면 대부분 react-native-reanimated을 사용합니다.

https://docs.swmansion.com/react-native-reanimated/

 

React Native Reanimated

A powerful animation library that makes it easy to create smooth animations and interactions that run in the UI thread.

docs.swmansion.com

 

 

관련글 더보기

댓글 영역