KAU-SMART-PETS / Capstone_FE

0 stars 0 forks source link

"Warning : key prop spreading to JSX" 관련 #5

Closed Wendy-Nam closed 3 days ago

Wendy-Nam commented 4 days ago
 ERROR  Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, route: ..., borderless: ..., centered: ..., rippleColor: ..., onPress: ..., onLongPress: ..., testID: ..., accessibilityLabel: ..., accessibilityRole: ..., accessibilityState: ..., style: ..., children: ...};
  <Touchable {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {route: ..., borderless: ..., centered: ..., rippleColor: ..., onPress: ..., onLongPress: ..., testID: ..., accessibilityLabel: ..., accessibilityRole: ..., accessibilityState: ..., style: ..., children: ...};
  <Touchable key={someKey} {...props} />
    in BottomNavigation.Bar (created by BottomNavigation)
    in RCTView (created by View)
    in View (created by BottomNavigation)
    in BottomNavigation (created by MaterialBottomTabViewInner)
    in MaterialBottomTabViewInner (created by MaterialBottomTabView)

해당 이슈는 하단탭 navigator 관련 라이브러리 이슈로 추정됨.

해결책은 아래와 같음

https://github.com/react-navigation/react-navigation/issues/11989#issuecomment-2304602233 https://github.com/react-navigation/react-navigation/issues/11989#issuecomment-2299781133

라이브러리 패치 파일에 대해, 팀원과 공유되지 않을 수 있고 yarn install 시 이전버전으로 재설치될 수 있어 아직 패치를 진행하지 않음. 또한, 해당 경고는 파일의 실행에 지장이 없기 때문에, 현재로선 그대로 진행한 뒤 최종버전 쯤에서 패치를 진행하려는 계획임.

Wendy-Nam commented 3 days ago

결론 : 기존의 MaterialBottomTab 대신 BottomTab으로 교체 후, 이전의 디자인/애니메이션과 같게 조정작업을 마침