0.71+ Flatlist 의 listKey 삭제

2023. 5. 10. 09:53Develop/React-Native

리액트네이티브 버전 0.71+ 에서는 Flatlist의 listKey가 제거되었습니다.
https://github.com/facebook/react-native/blob/main/CHANGELOG.md#removed

 

GitHub - facebook/react-native: A framework for building native applications using React

A framework for building native applications using React - GitHub - facebook/react-native: A framework for building native applications using React

github.com

 

listKey는 Flatlist를 한 페이지에 여러번 사용할때 리스트의 고유한 키값을 주고 독립적으로 활용하기 위해 도입된 장치입니다만

0.71+ 부터는 flow check, regex replace, 수동 검사의 조합으로 대체하여 독립적인 Flatlist임을 확인한다고합니다.

https://github.com/facebook/react-native/commit/bc5cb7cd7933da707c02ff0dd993c607ba7d40b3

 

Remove usages of listKey · facebook/react-native@bc5cb7c

Summary: Now that the prop noops, remove the usages of the property. This is the point of no return for the prop. Replaced listKey usage with a combination of `flow check`, regex replace, manual i...

github.com

 

따라서 0.71+ 를 사용하시는 분들께서는 listKey를 삭제해주셔도 될거같습니다!